1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Test Hash#to_param escapes keys and values

[#5175]
This commit is contained in:
Santiago Pastorino 2010-07-22 06:16:27 +08:00 committed by Aaron Patterson
parent 5c85822008
commit 6cbd085f69

View file

@ -472,6 +472,10 @@ class HashExtToParamTests < Test::Unit::TestCase
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