logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

two_factor_authentications_controller_spec.rb (512B)


  1. require 'rails_helper'
  2. describe Admin::TwoFactorAuthenticationsController do
  3. render_views
  4. let(:user) { Fabricate(:user, otp_required_for_login: true) }
  5. before do
  6. sign_in Fabricate(:user, admin: true), scope: :user
  7. end
  8. describe 'DELETE #destroy' do
  9. it 'redirects to admin accounts page' do
  10. delete :destroy, params: { user_id: user.id }
  11. user.reload
  12. expect(user.otp_required_for_login).to eq false
  13. expect(response).to redirect_to(admin_accounts_path)
  14. end
  15. end
  16. end