Allow admins to manually confirm users
This commit is contained in:
parent
8b831b1977
commit
3eeba6cbb0
4 changed files with 31 additions and 2 deletions
|
|
@ -2,8 +2,23 @@ require 'spec_helper'
|
|||
|
||||
feature User do
|
||||
|
||||
shared_examples 'admin ability' do
|
||||
let(:admin) { create(:admin) }
|
||||
|
||||
shared_examples 'admin ability' do
|
||||
scenario 'manually confirm unconfirmed users', feature: true, js: true do
|
||||
sign_in admin
|
||||
user = create(:user, confirmed_at: nil)
|
||||
expect(user.confirmed?).to be false
|
||||
visit admin_users_path
|
||||
|
||||
within('tr', text: user.name) do
|
||||
expect(page.has_content?('unconfirmed')).to be true
|
||||
click_link 'Confirm'
|
||||
end
|
||||
|
||||
user.reload
|
||||
expect(user.confirmed?).to be true
|
||||
end
|
||||
end
|
||||
|
||||
describe 'admin' do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue