diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-12 08:52:40 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-12-12 08:52:40 -0800 |
commit | 6e2b734f56e4c789763b9a8e3922272a004a325f (patch) | |
tree | 03fb8733f0b40cb5587d49438229841b0ba97bf5 /activesupport/test | |
parent | 07fd25c759b079a12dcd087aeacf39deb3e549d0 (diff) | |
parent | 1f80e8d6856837dd78a4af756e1b26cf06b17fc2 (diff) | |
download | rails-6e2b734f56e4c789763b9a8e3922272a004a325f.tar.gz rails-6e2b734f56e4c789763b9a8e3922272a004a325f.tar.bz2 rails-6e2b734f56e4c789763b9a8e3922272a004a325f.zip |
Merge pull request #13229 from vipulnsward/fix-10635-tests
Fix test-error introduced by #10635.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/message_verifier_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/test/message_verifier_test.rb b/activesupport/test/message_verifier_test.rb index f208814468..a5748d28ba 100644 --- a/activesupport/test/message_verifier_test.rb +++ b/activesupport/test/message_verifier_test.rb @@ -55,6 +55,20 @@ class MessageVerifierTest < ActiveSupport::TestCase ActiveSupport.use_standard_json_time_format = prev end + def test_raise_error_when_argument_class_is_not_loaded + # To generate the valid message below: + # + # AutoloadClass = Struct.new(:foo) + # valid_message = @verifier.generate(foo: AutoloadClass.new('foo')) + # + valid_message = "BAh7BjoIZm9vbzonTWVzc2FnZVZlcmlmaWVyVGVzdDo6QXV0b2xvYWRDbGFzcwY6CUBmb29JIghmb28GOgZFVA==--f3ef39a5241c365083770566dc7a9eb5d6ace914" + exception = assert_raise(ArgumentError, NameError) do + @verifier.verify(valid_message) + end + assert_includes ["uninitialized constant MessageVerifierTest::AutoloadClass", + "undefined class/module MessageVerifierTest::AutoloadClass"], exception.message + end + def assert_not_verified(message) assert_raise(ActiveSupport::MessageVerifier::InvalidSignature) do @verifier.verify(message) |