diff options
author | Xavier Noria <fxn@hashref.com> | 2010-09-11 11:04:19 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-09-11 11:05:00 +0200 |
commit | a87b92db7b738cf86deac15d69f4159b2f87d79e (patch) | |
tree | 20cf6f72b45ed922ba0329b74d952b887635897c /actionpack/test/controller | |
parent | f6153f74da29f56017d5ddb8a2b8869d9b5835d7 (diff) | |
download | rails-a87b92db7b738cf86deac15d69f4159b2f87d79e.tar.gz rails-a87b92db7b738cf86deac15d69f4159b2f87d79e.tar.bz2 rails-a87b92db7b738cf86deac15d69f4159b2f87d79e.zip |
revises implementation and documentation of csrf_meta_tags, and aliases csrf_meta_tag to it for backwards compatibilty
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/request_forgery_protection_test.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/test/controller/request_forgery_protection_test.rb b/actionpack/test/controller/request_forgery_protection_test.rb index 5ec760d4ea..7e169431f4 100644 --- a/actionpack/test/controller/request_forgery_protection_test.rb +++ b/actionpack/test/controller/request_forgery_protection_test.rb @@ -1,5 +1,6 @@ require 'abstract_unit' require 'digest/sha1' +require 'active_support/core_ext/string/strip' # common controller actions module RequestForgeryProtectionActions @@ -16,7 +17,7 @@ module RequestForgeryProtectionActions end def meta - render :inline => "<%= csrf_meta_tag %>" + render :inline => "<%= csrf_meta_tags %>" end def rescue_action(e) raise e end @@ -219,7 +220,10 @@ class RequestForgeryProtectionControllerTest < ActionController::TestCase test 'should emit a csrf-token meta tag' do ActiveSupport::SecureRandom.stubs(:base64).returns(@token + '<=?') get :meta - assert_equal %(<meta name="csrf-param" content="authenticity_token"/>\n<meta name="csrf-token" content="cf50faa3fe97702ca1ae<=?"/>), @response.body + assert_equal <<-METAS.strip_heredoc, @response.body + <meta name="csrf-param" content="authenticity_token"/> + <meta name="csrf-token" content="cf50faa3fe97702ca1ae<=?"/> + METAS end end |