aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-07-22 06:16:27 +0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-22 06:29:59 +0800
commit6cbd085f692aae7518ac67380e805ebb65896951 (patch)
tree1d6b025b3429af529d0e38912ef7e618ee48f53e /activesupport
parent5c858220085dc4ddc1bec496747059dfbe32f1da (diff)
downloadrails-6cbd085f692aae7518ac67380e805ebb65896951.tar.gz
rails-6cbd085f692aae7518ac67380e805ebb65896951.tar.bz2
rails-6cbd085f692aae7518ac67380e805ebb65896951.zip
Test Hash#to_param escapes keys and values
[#5175]
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index f369f55675..5d9846a216 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -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