fix spec failures
This commit is contained in:
parent
b33c638483
commit
efb3d5e70f
4 changed files with 4 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue