Commit efb3d5e7 authored by James Lopez's avatar James Lopez

fix spec failures

parent b33c6384
......@@ -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
......
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