Rerender if wrong credentials
This commit is contained in:
parent
9a6b3c3757
commit
1b14d85c77
2 changed files with 2 additions and 3 deletions
|
@ -31,8 +31,7 @@ class Users::SessionsController < Devise::SessionsController
|
|||
redirect_to after_sign_in_path_for(:user)
|
||||
else
|
||||
flash.alert = 'Mauvais couple login / mot de passe'
|
||||
new
|
||||
render :new, status: 401
|
||||
render :new, assigns: { user: User.new }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ describe Users::SessionsController, type: :controller do
|
|||
it 'fails to sign in with bad credentials' do
|
||||
subject
|
||||
|
||||
expect(response.unauthorized?).to be(true)
|
||||
expect(response).to render_template(:new)
|
||||
expect(controller.current_user).to be(nil)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue