diff options
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 |