Commit efb3d5e7 authored by James Lopez's avatar James Lopez

fix spec failures

parent b33c6384
...@@ -152,7 +152,7 @@ class Admin::UsersController < Admin::ApplicationController ...@@ -152,7 +152,7 @@ class Admin::UsersController < Admin::ApplicationController
def remove_email def remove_email
email = user.emails.find(params[:email_id]) email = user.emails.find(params[:email_id])
success = Emails::DestroyService.new(current_user, user, email: email.email).execute success = Emails::DestroyService.new(user, email: email.email).execute
respond_to do |format| respond_to do |format|
if success if success
......
...@@ -41,10 +41,8 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController ...@@ -41,10 +41,8 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
def create def create
if current_user.validate_and_consume_otp!(params[:pin_code]) if current_user.validate_and_consume_otp!(params[:pin_code])
codes = nil
Users::UpdateService.new(current_user, otp_required_for_login: true).execute! do |user| Users::UpdateService.new(current_user, otp_required_for_login: true).execute! do |user|
codes = user.generate_otp_backup_codes! @codes = user.generate_otp_backup_codes!
end end
render 'create' render 'create'
......
...@@ -4,7 +4,7 @@ describe Emails::CreateService, services: true do ...@@ -4,7 +4,7 @@ describe Emails::CreateService, services: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:opts) { { email: 'new@email.com' } } let(:opts) { { email: 'new@email.com' } }
subject(:service) { described_class.new(user, user, opts) } subject(:service) { described_class.new(user, opts) }
describe '#execute' do describe '#execute' do
it 'creates an email with valid attributes' do it 'creates an email with valid attributes' do
......
...@@ -4,7 +4,7 @@ describe Emails::DestroyService, services: true do ...@@ -4,7 +4,7 @@ describe Emails::DestroyService, services: true do
let!(:user) { create(:user) } let!(:user) { create(:user) }
let!(:email) { create(:email, user: user) } let!(:email) { create(:email, user: user) }
subject(:service) { described_class.new(user, user, email: email.email) } subject(:service) { described_class.new(user, email: email.email) }
describe '#execute' do describe '#execute' do
it 'removes an email' do it 'removes an email' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment