aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/request_forgery_protection_test.rb
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-03-28 17:58:15 +0200
committerPiotr Sarnacki <drogus@gmail.com>2012-03-28 18:03:16 +0200
commit5a5ca14cb2f636b9edf03b56bd9aae4cef5c7200 (patch)
tree80c7c971da33cd5a3d63c15e1c36afad87f022b7 /actionpack/test/controller/request_forgery_protection_test.rb
parent128cfbdf4d316a544a76e5c58dbeac153f3d4e36 (diff)
downloadrails-5a5ca14cb2f636b9edf03b56bd9aae4cef5c7200.tar.gz
rails-5a5ca14cb2f636b9edf03b56bd9aae4cef5c7200.tar.bz2
rails-5a5ca14cb2f636b9edf03b56bd9aae4cef5c7200.zip
Cover one more case in auth_token and remote forms
If embedding auth_token in remote forms is off and we pass a value for auth_token it should respect it.
Diffstat (limited to 'actionpack/test/controller/request_forgery_protection_test.rb')
-rw-r--r--actionpack/test/controller/request_forgery_protection_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/controller/request_forgery_protection_test.rb b/actionpack/test/controller/request_forgery_protection_test.rb
index 89f605b5ad..066cd523be 100644
--- a/actionpack/test/controller/request_forgery_protection_test.rb
+++ b/actionpack/test/controller/request_forgery_protection_test.rb
@@ -149,6 +149,13 @@ module RequestForgeryProtectionTests
end
end
+ def test_should_render_form_with_token_tag_if_remote_and_external_authenticity_token_requested
+ assert_not_blocked do
+ get :form_for_remote_with_external_token
+ end
+ assert_select 'form>div>input[name=?][value=?]', 'custom_authenticity_token', 'external_token'
+ end
+
def test_should_render_form_with_token_tag_if_remote_and_authenticity_token_requested
assert_not_blocked do
get :form_for_remote_with_token