aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/object/to_query_test.rb
diff options
context:
space:
mode:
authorbrainopia <brainopia@evilmartians.com>2011-09-16 22:59:16 +0400
committerbrainopia <brainopia@evilmartians.com>2011-09-16 22:59:16 +0400
commit3a04e370e4cc016bb7b59fe6bb704e4ca37d62f3 (patch)
tree2a5ac65d1b3ee91e0abff8226e7efdf3b6e80af6 /activesupport/test/core_ext/object/to_query_test.rb
parente314b3ff6d074ee0ea4c314e6ca1083469780449 (diff)
downloadrails-3a04e370e4cc016bb7b59fe6bb704e4ca37d62f3.tar.gz
rails-3a04e370e4cc016bb7b59fe6bb704e4ca37d62f3.tar.bz2
rails-3a04e370e4cc016bb7b59fe6bb704e4ca37d62f3.zip
Fix Hash#to_query edge case with html_safe string on 1.8 ruby
Diffstat (limited to 'activesupport/test/core_ext/object/to_query_test.rb')
-rw-r--r--activesupport/test/core_ext/object/to_query_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/object/to_query_test.rb b/activesupport/test/core_ext/object/to_query_test.rb
index 84da52f4bf..c146f6cc9b 100644
--- a/activesupport/test/core_ext/object/to_query_test.rb
+++ b/activesupport/test/core_ext/object/to_query_test.rb
@@ -1,6 +1,7 @@
require 'abstract_unit'
require 'active_support/ordered_hash'
require 'active_support/core_ext/object/to_query'
+require 'active_support/core_ext/string/output_safety.rb'
class ToQueryTest < Test::Unit::TestCase
def test_simple_conversion
@@ -11,6 +12,14 @@ class ToQueryTest < Test::Unit::TestCase
assert_query_equal 'a%3Ab=c+d', 'a:b' => 'c d'
end
+ def test_html_safe_parameter_key
+ assert_query_equal 'a%3Ab=c+d', 'a:b'.html_safe => 'c d'
+ end
+
+ def test_html_safe_parameter_value
+ assert_query_equal 'a=%5B10%5D', 'a' => '[10]'.html_safe
+ end
+
def test_nil_parameter_value
empty = Object.new
def empty.to_param; nil end