mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Implemented ability of admins to manually confirm users
This commit is contained in:
parent
6c2dc92b84
commit
c50e8c0466
7 changed files with 90 additions and 16 deletions
|
|
@ -18,6 +18,19 @@ describe Admin::UsersController do
|
|||
expect(response).to render_template :index
|
||||
end
|
||||
end
|
||||
describe 'PATCH #toggle_confirmation' do
|
||||
it 'confirms user' do
|
||||
user_to_confirm = create(:user, email: 'unconfirmed_user@osem.io', confirmed_at: nil)
|
||||
patch :toggle_confirmation, id: user_to_confirm.id, user: { to_confirm: 'true' }
|
||||
user_to_confirm.reload
|
||||
expect(user_to_confirm.confirmed?).to eq true
|
||||
end
|
||||
it 'undo confirmation of user' do
|
||||
patch :toggle_confirmation, id: user.id, user: { to_confirm: 'false' }
|
||||
user.reload
|
||||
expect(user.confirmed?).to eq false
|
||||
end
|
||||
end
|
||||
describe 'PATCH #update' do
|
||||
context 'valid attributes' do
|
||||
before :each do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue