提交 6cbd085f 编写于 作者: S Santiago Pastorino 提交者: Aaron Patterson

Test Hash#to_param escapes keys and values

[#5175]
上级 5c858220
......@@ -472,6 +472,10 @@ def test_number_hash
def test_to_param_hash
assert_equal 'custom=param-1&custom2=param2-1', ActiveSupport::OrderedHash[ToParam.new('custom'), ToParam.new('param'), ToParam.new('custom2'), ToParam.new('param2')].to_param
end
def test_to_param_hash_escapes_its_keys_and_values
assert_equal 'param+1=A+string+with+%2F+characters+%26+that+should+be+%3F+escaped', { 'param 1' => 'A string with / characters & that should be ? escaped' }.to_param
end
end
class HashToXmlTest < Test::Unit::TestCase
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册