Permalink
Browse files

Don't need to use a controller to test the verifier

  • Loading branch information...
1 parent f98bd42 commit 9d86f6ce6efbe9b8b03c0992945bc2d056e6678e @rafaelfranca rafaelfranca committed Nov 22, 2013
Showing with 3 additions and 9 deletions.
  1. +3 −9 railties/test/application/configuration_test.rb
@@ -274,19 +274,13 @@ def index
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

0 comments on commit 9d86f6c

Please sign in to comment.