This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2017-05-02 21:07:12 +02:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe Admin::TwoFactorAuthenticationsController do
|
|
|
|
render_views
|
|
|
|
|
2017-05-29 18:08:58 +02:00
|
|
|
let(:user) { Fabricate(:user, otp_required_for_login: true) }
|
2017-05-02 21:07:12 +02:00
|
|
|
before do
|
|
|
|
sign_in Fabricate(:user, admin: true), scope: :user
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'DELETE #destroy' do
|
|
|
|
it 'redirects to admin accounts page' do
|
|
|
|
delete :destroy, params: { user_id: user.id }
|
2017-05-29 18:08:58 +02:00
|
|
|
|
|
|
|
user.reload
|
|
|
|
expect(user.otp_required_for_login).to eq false
|
2017-05-02 21:07:12 +02:00
|
|
|
expect(response).to redirect_to(admin_accounts_path)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|