Spec: specify locked logic

This commit is contained in:
simon lehericey 2019-08-16 14:17:39 +02:00
parent 1b14d85c77
commit 08bb393ced
2 changed files with 22 additions and 0 deletions

View file

@ -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