diff options
author | Jeffrey Hardy <packagethief@gmail.com> | 2009-10-05 08:27:54 -0400 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-10-05 13:38:26 -0700 |
commit | 9212138ad0a9ae3285a2566300afb7d94344214a (patch) | |
tree | 20a7f533fa98fb449f94ae903197dcc86c050d83 /activesupport/test | |
parent | b480da5cd65de966ac14bbdc52b2fae3ffc06547 (diff) | |
download | rails-9212138ad0a9ae3285a2566300afb7d94344214a.tar.gz rails-9212138ad0a9ae3285a2566300afb7d94344214a.tar.bz2 rails-9212138ad0a9ae3285a2566300afb7d94344214a.zip |
MessageVerifier#verify raises InvalidSignature if the signature is blank
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/message_verifier_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/message_verifier_test.rb b/activesupport/test/message_verifier_test.rb index 4f8837ba4e..e6370bc3db 100644 --- a/activesupport/test/message_verifier_test.rb +++ b/activesupport/test/message_verifier_test.rb @@ -18,6 +18,11 @@ class MessageVerifierTest < Test::Unit::TestCase assert_equal @data, @verifier.verify(message) end + def test_missing_signature_raises + assert_not_verified(nil) + assert_not_verified("") + end + def test_tampered_data_raises data, hash = @verifier.generate(@data).split("--") assert_not_verified("#{data.reverse}--#{hash}") |