提交 535a3b6a 编写于 作者: T Timm

Nokogiri leaves '<' unescaped, so the assert_select looking for '&lt;' will...

Nokogiri leaves '<' unescaped, so the assert_select looking for '&lt;' will never work. Switched to assert_matching the reponse body.
上级 af05b015
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册