mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Fix issue #1928, thanks to @ejfinneran for a test case
This commit is contained in:
parent
9678b422ff
commit
cbc6926e3d
3 changed files with 14 additions and 1 deletions
|
@ -87,7 +87,7 @@ GEM
|
|||
omniauth-openid (1.0.1)
|
||||
omniauth (~> 1.0)
|
||||
rack-openid (~> 1.3.1)
|
||||
orm_adapter (0.1.0)
|
||||
orm_adapter (0.3.0)
|
||||
polyglot (0.3.3)
|
||||
rack (1.4.1)
|
||||
rack-cache (1.2)
|
||||
|
|
|
@ -45,6 +45,7 @@ module Devise
|
|||
def sign_in(resource_or_scope, resource=nil)
|
||||
scope ||= Devise::Mapping.find_scope!(resource_or_scope)
|
||||
resource ||= resource_or_scope
|
||||
warden.instance_variable_get(:@users).delete(scope)
|
||||
warden.session_serializer.store(resource, scope)
|
||||
end
|
||||
|
||||
|
|
|
@ -47,6 +47,18 @@ class TestHelpersTest < ActionController::TestCase
|
|||
assert_response :success
|
||||
end
|
||||
|
||||
test "does not redirect with valid user after failed first attempt" do
|
||||
get :index
|
||||
assert_response :redirect
|
||||
|
||||
user = create_user
|
||||
user.confirm!
|
||||
|
||||
sign_in user
|
||||
get :index
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "redirects if valid user signed out" do
|
||||
user = create_user
|
||||
user.confirm!
|
||||
|
|
Loading…
Add table
Reference in a new issue