aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-11-22 00:03:28 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-12-04 22:56:48 -0200
commit9d86f6ce6efbe9b8b03c0992945bc2d056e6678e (patch)
treefad26045e34ded8829a2555bc041c3f7e2b15938 /railties
parentf98bd42854cc00868cd3f17fe164f32be7315d6b (diff)
downloadrails-9d86f6ce6efbe9b8b03c0992945bc2d056e6678e.tar.gz
rails-9d86f6ce6efbe9b8b03c0992945bc2d056e6678e.tar.bz2
rails-9d86f6ce6efbe9b8b03c0992945bc2d056e6678e.zip
Don't need to use a controller to test the verifier
Diffstat (limited to 'railties')
-rw-r--r--railties/test/application/configuration_test.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb
index 6b19acb482..0ffe8a87a8 100644
--- a/railties/test/application/configuration_test.rb
+++ b/railties/test/application/configuration_test.rb
@@ -274,19 +274,13 @@ module ApplicationTests
app.config.session_store :disabled
end
- class ::OmgController < ActionController::Base
- def index
- render text: Rails.application.message_verifier.generate("some_value")
- end
- end
+ message = app.message_verifier.generate("some_value")
- get "/"
-
- assert_equal 'some_value', Rails.application.message_verifier.verify(last_response.body)
+ assert_equal 'some_value', Rails.application.message_verifier.verify(message)
secret = app.key_generator.generate_key('default')
verifier = ActiveSupport::MessageVerifier.new(secret)
- assert_equal 'some_value', verifier.verify(last_response.body)
+ assert_equal 'some_value', verifier.verify(message)
end
test "application verifier can build different verifiers" do