aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/message_verifier_test.rb
diff options
context:
space:
mode:
authorWillem van Bergen <willem@vanbergen.org>2011-09-15 15:51:30 -0400
committerWillem van Bergen <willem@vanbergen.org>2011-09-15 15:51:30 -0400
commit6d520803ee005d47c876662ba426083e823199ed (patch)
tree9ac563affb6d71dc06943ddf296462afe41761d3 /activesupport/test/message_verifier_test.rb
parent41fea0334232824d5d509a6924e8c8487d53494b (diff)
downloadrails-6d520803ee005d47c876662ba426083e823199ed.tar.gz
rails-6d520803ee005d47c876662ba426083e823199ed.tar.bz2
rails-6d520803ee005d47c876662ba426083e823199ed.zip
Test deprecation warning when not using an options hash as second parameter.
Diffstat (limited to 'activesupport/test/message_verifier_test.rb')
-rw-r--r--activesupport/test/message_verifier_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/test/message_verifier_test.rb b/activesupport/test/message_verifier_test.rb
index 3dc047c126..35747abe5b 100644
--- a/activesupport/test/message_verifier_test.rb
+++ b/activesupport/test/message_verifier_test.rb
@@ -10,7 +10,7 @@ else
require 'active_support/time'
require 'active_support/json'
-class MessageVerifierTest < Test::Unit::TestCase
+class MessageVerifierTest < ActiveSupport::TestCase
class JSONSerializer
def dump(value)
@@ -49,6 +49,12 @@ class MessageVerifierTest < Test::Unit::TestCase
message = verifier.generate({ :foo => 123, 'bar' => Time.utc(2010) })
assert_equal verifier.verify(message), { "foo" => 123, "bar" => "2010-01-01T00:00:00Z" }
end
+
+ def test_digest_algorithm_as_second_parameter_deprecation
+ assert_deprecated(/options hash/) do
+ ActiveSupport::MessageVerifier.new("secret", "SHA1")
+ end
+ end
def assert_not_verified(message)
assert_raise(ActiveSupport::MessageVerifier::InvalidSignature) do