diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-10 23:30:32 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-10 23:30:32 -0700 |
commit | a792ad6db946d0f4b6b75938b76a6389863fb23a (patch) | |
tree | add11b4c00ada95bc9fba99c4cd92dfbeb868a59 /railties | |
parent | af88daefe05379b2be08e635a92987f56bc5cc97 (diff) | |
parent | 8366cabd652a5fbb56fc0942614fbc965e7e45ed (diff) | |
download | rails-a792ad6db946d0f4b6b75938b76a6389863fb23a.tar.gz rails-a792ad6db946d0f4b6b75938b76a6389863fb23a.tar.bz2 rails-a792ad6db946d0f4b6b75938b76a6389863fb23a.zip |
Merge pull request #506 from dlee/custom_csrf_token_tests
Test csrf token param name customization
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/configuration_test.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 6193e72625..43876c0a72 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -225,8 +225,6 @@ module ApplicationTests make_basic_app class ::OmgController < ActionController::Base - protect_from_forgery - def index render :inline => "<%= csrf_meta_tags %>" end @@ -236,6 +234,21 @@ module ApplicationTests assert last_response.body =~ /csrf\-param/ end + test "request forgery token param can be changed" do + make_basic_app do + app.config.action_controller.request_forgery_protection_token = '_xsrf_token_here' + end + + class ::OmgController < ActionController::Base + def index + render :inline => "<%= csrf_meta_tags %>" + end + end + + get "/" + assert last_response.body =~ /_xsrf_token_here/ + end + test "config.action_controller.perform_caching = true" do make_basic_app do |app| app.config.action_controller.perform_caching = true |