diff options
author | David Lee <davidomundo@gmail.com> | 2011-05-09 16:17:38 -0700 |
---|---|---|
committer | David Lee <davidomundo@gmail.com> | 2011-05-10 18:24:14 -0700 |
commit | 8366cabd652a5fbb56fc0942614fbc965e7e45ed (patch) | |
tree | 6708194625e59b73d58580ed43682ea3e07c0e53 /railties/test | |
parent | fa187ec77867ac732b08fd2d5cb4d98712fc3313 (diff) | |
download | rails-8366cabd652a5fbb56fc0942614fbc965e7e45ed.tar.gz rails-8366cabd652a5fbb56fc0942614fbc965e7e45ed.tar.bz2 rails-8366cabd652a5fbb56fc0942614fbc965e7e45ed.zip |
Test csrf token param name customization
Diffstat (limited to 'railties/test')
-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 |