mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
sign_in should return true in case user is already signed in and assert that.
This commit is contained in:
parent
0f8f786f9f
commit
873e49ab66
2 changed files with 2 additions and 1 deletions
|
@ -106,6 +106,7 @@ module Devise
|
|||
warden.session_serializer.store(resource, scope)
|
||||
elsif warden.user(scope) == resource && !options.delete(:force)
|
||||
# Do nothing. User already signed in and we are not forcing it.
|
||||
true
|
||||
else
|
||||
warden.set_user(resource, options.merge!(:scope => scope))
|
||||
end
|
||||
|
|
|
@ -106,7 +106,7 @@ class ControllerAuthenticatableTest < ActionController::TestCase
|
|||
user = User.new
|
||||
@mock_warden.expects(:user).returns(user)
|
||||
@mock_warden.expects(:set_user).never
|
||||
@controller.sign_in(user)
|
||||
assert @controller.sign_in(user)
|
||||
end
|
||||
|
||||
test 'sign in again when the user is already in only if force is given' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue