diff options
author | James Lopez <james@jameslopez.es> | 2017-06-23 20:00:22 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-06-23 20:00:22 +0300 |
commit | efb3d5e70f163bfd186fa3a02c967154103d27f4 (patch) | |
tree | e6a10e17d40f8ad0c02f4a770383d462438a223e | |
parent | b33c638483d6b87ba71a329275ff12e5eb865d72 (diff) |
fix spec failures
-rw-r--r-- | app/controllers/admin/users_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/profiles/two_factor_auths_controller.rb | 4 | ||||
-rw-r--r-- | spec/services/emails/create_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/emails/destroy_service_spec.rb | 2 |
4 files changed, 4 insertions, 6 deletions
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 7b65836eef7..fa1bc72560e 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -152,7 +152,7 @@ class Admin::UsersController < Admin::ApplicationController def remove_email 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| if success diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb index a864f86f3dd..1a4f77639e7 100644 --- a/app/controllers/profiles/two_factor_auths_controller.rb +++ b/app/controllers/profiles/two_factor_auths_controller.rb @@ -41,10 +41,8 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController def create 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| - codes = user.generate_otp_backup_codes! + @codes = user.generate_otp_backup_codes! end render 'create' diff --git a/spec/services/emails/create_service_spec.rb b/spec/services/emails/create_service_spec.rb index 76bf35d34e8..c1f477f551e 100644 --- a/spec/services/emails/create_service_spec.rb +++ b/spec/services/emails/create_service_spec.rb @@ -4,7 +4,7 @@ describe Emails::CreateService, services: true do let(:user) { create(:user) } let(:opts) { { email: 'new@email.com' } } - subject(:service) { described_class.new(user, user, opts) } + subject(:service) { described_class.new(user, opts) } describe '#execute' do it 'creates an email with valid attributes' do diff --git a/spec/services/emails/destroy_service_spec.rb b/spec/services/emails/destroy_service_spec.rb index 3f5192b620e..5e7ab4a40af 100644 --- a/spec/services/emails/destroy_service_spec.rb +++ b/spec/services/emails/destroy_service_spec.rb @@ -4,7 +4,7 @@ describe Emails::DestroyService, services: true do let!(:user) { create(: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 it 'removes an email' do |