Spec: specify locked logic
This commit is contained in:
parent
1b14d85c77
commit
08bb393ced
2 changed files with 22 additions and 0 deletions
|
@ -36,6 +36,17 @@ describe Users::SessionsController, type: :controller do
|
|||
expect(response).to redirect_to(stored_path)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the user is locked' do
|
||||
before { user.lock_access! }
|
||||
|
||||
it 'redirects to new_path' do
|
||||
subject
|
||||
|
||||
expect(response).to redirect_to(new_user_session_path)
|
||||
expect(flash.alert).to eq(I18n.t('devise.failure.invalid'))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the credentials are wrong' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue