aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/request_forgery_protection_test.rb
diff options
context:
space:
mode:
authorTimm <kaspth@gmail.com>2013-09-20 20:51:08 +0200
committerTimm <kaspth@gmail.com>2014-06-16 21:04:15 +0200
commit535a3b6af7a41ce33356c36296acd26786de7e55 (patch)
treeab11408d168b05350f7c84f1fbf7bff760d4181d /actionpack/test/controller/request_forgery_protection_test.rb
parentaf05b0150599b77a0c148adf2bf5cdf44ec053e1 (diff)
downloadrails-535a3b6af7a41ce33356c36296acd26786de7e55.tar.gz
rails-535a3b6af7a41ce33356c36296acd26786de7e55.tar.bz2
rails-535a3b6af7a41ce33356c36296acd26786de7e55.zip
Nokogiri leaves '<' unescaped, so the assert_select looking for '&lt;' will never work. Switched to assert_matching the reponse body.
Diffstat (limited to 'actionpack/test/controller/request_forgery_protection_test.rb')
-rw-r--r--actionpack/test/controller/request_forgery_protection_test.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/test/controller/request_forgery_protection_test.rb b/actionpack/test/controller/request_forgery_protection_test.rb
index f9935bf893..58b8e96a4e 100644
--- a/actionpack/test/controller/request_forgery_protection_test.rb
+++ b/actionpack/test/controller/request_forgery_protection_test.rb
@@ -386,10 +386,11 @@ class RequestForgeryProtectionControllerUsingResetSessionTest < ActionController
end
test 'should emit a csrf-param meta tag and a csrf-token meta tag' do
- SecureRandom.stubs(:base64).returns(@token + 'U+003c=U+0022U+003fU+0022') # '<="?"'
+ SecureRandom.stubs(:base64).returns(@token + '<=?') # '<="?"'
get :meta
assert_select 'meta[name=?][content=?]', 'csrf-param', 'custom_authenticity_token'
- assert_select 'meta[name=?][content=?]', 'csrf-token', 'cf50faa3fe97702ca1aeU+003c=U+0022U+003fU+0022'
+ assert_select 'meta[name=?]', 'csrf-token'
+ assert_match(/cf50faa3fe97702ca1ae&lt;=\?/, @response.body)
end
end