Skip to content

Commit

Permalink
Add even more cookie tests, fixed InvalidMessage exception scope
Browse files Browse the repository at this point in the history
  • Loading branch information
fxposter committed Nov 22, 2012
1 parent 52a4346 commit ba7d38a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/middleware/cookies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def [](name)
@encryptor.decrypt_and_verify(encrypted_message)
end
rescue ActiveSupport::MessageVerifier::InvalidSignature,
ActiveSupport::MessageVerifier::InvalidMessage
ActiveSupport::MessageEncryptor::InvalidMessage
nil
end

Expand Down
2 changes: 2 additions & 0 deletions actionpack/test/dispatch/cookies_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ def test_delete_and_set_signed_permanent_encrypted_cookie
assert_nil @controller.send(:cookies)[:user_name]
assert_nil @controller.send(:cookies).signed.permanent.encrypted[:user_name]
assert_equal @controller.send(:cookies).signed.permanent.encrypted[:user_surname], 'Smith'
assert_not_equal @controller.send(:cookies)[:user_surname], 'Smith'
assert_not_equal @controller.send(:cookies).encrypted[:user_surname], 'Smith'
end

def test_delete_and_set_cookie
Expand Down

0 comments on commit ba7d38a

Please sign in to comment.