aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-03-11 13:26:28 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-03-11 13:26:28 +0000
commit8a7275e7f4addaf7e7f42e32abc23121be87631b (patch)
tree84f3774b3c9a486fa695d0b53dfbf452869aad96 /activesupport/test
parent3edc98a1cc6c3a701ea1ca7d4525623c2d3b4259 (diff)
downloadrails-8a7275e7f4addaf7e7f42e32abc23121be87631b.tar.gz
rails-8a7275e7f4addaf7e7f42e32abc23121be87631b.tar.bz2
rails-8a7275e7f4addaf7e7f42e32abc23121be87631b.zip
Array#to_query preserves its ordering. References #7756.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6378 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index 8a120fdfee..64d550aaf5 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -544,7 +544,7 @@ class QueryTest < Test::Unit::TestCase
end
def test_nested_conversion
- assert_query_equal 'person%5Bname%5D=Nicholas&person%5Blogin%5D=seckar',
+ assert_query_equal 'person%5Blogin%5D=seckar&person%5Bname%5D=Nicholas',
:person => {:name => 'Nicholas', :login => 'seckar'}
end
@@ -558,8 +558,13 @@ class QueryTest < Test::Unit::TestCase
:person => {:id => [10, 20]}
end
+ def test_array_values_are_not_sorted
+ assert_query_equal 'person%5Bid%5D%5B%5D=20&person%5Bid%5D%5B%5D=10',
+ :person => {:id => [20, 10]}
+ end
+
private
def assert_query_equal(expected, actual, message = nil)
- assert_equal expected.split('&').sort, actual.to_query.split('&').sort
+ assert_equal expected.split('&'), actual.to_query.split('&')
end
end