From a87b92db7b738cf86deac15d69f4159b2f87d79e Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sat, 11 Sep 2010 11:04:19 +0200 Subject: revises implementation and documentation of csrf_meta_tags, and aliases csrf_meta_tag to it for backwards compatibilty --- actionpack/test/controller/request_forgery_protection_test.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'actionpack/test/controller') 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 %(\n), @response.body + assert_equal <<-METAS.strip_heredoc, @response.body + + + METAS end end -- cgit v1.2.3