about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2017-05-30 01:08:58 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-05-29 18:08:58 +0200
commit2e27ce3b61a21918b5cfcfcfea328c4225c12744 (patch)
treec7dafdc027bfd193afa8fc43632eb38618c08ad9
parent2c10c5a0696c1ad4f891590abb611643ba592f48 (diff)
Spec #destroy feature of Admin::TwoFactorAuthenticationsController (#3355)
-rw-r--r--spec/controllers/admin/two_factor_authentications_controller_spec.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/controllers/admin/two_factor_authentications_controller_spec.rb b/spec/controllers/admin/two_factor_authentications_controller_spec.rb
index 69f26039a..4c1aa88d7 100644
--- a/spec/controllers/admin/two_factor_authentications_controller_spec.rb
+++ b/spec/controllers/admin/two_factor_authentications_controller_spec.rb
@@ -3,7 +3,7 @@ require 'rails_helper'
 describe Admin::TwoFactorAuthenticationsController do
   render_views
 
-  let(:user) { Fabricate(:user) }
+  let(:user) { Fabricate(:user, otp_required_for_login: true) }
   before do
     sign_in Fabricate(:user, admin: true), scope: :user
   end
@@ -11,6 +11,9 @@ describe Admin::TwoFactorAuthenticationsController do
   describe 'DELETE #destroy' do
     it 'redirects to admin accounts page' do
       delete :destroy, params: { user_id: user.id }
+
+      user.reload
+      expect(user.otp_required_for_login).to eq false
       expect(response).to redirect_to(admin_accounts_path)
     end
   end