mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-25 02:09:42 +00:00
21 lines
512 B
Ruby
21 lines
512 B
Ruby
require 'rails_helper'
|
|
|
|
describe Admin::TwoFactorAuthenticationsController do
|
|
render_views
|
|
|
|
let(:user) { Fabricate(:user, otp_required_for_login: true) }
|
|
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 }
|
|
|
|
user.reload
|
|
expect(user.otp_required_for_login).to eq false
|
|
expect(response).to redirect_to(admin_accounts_path)
|
|
end
|
|
end
|
|
end
|