aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-10-17 19:18:18 -0500
committerJoshua Peek <josh@joshpeek.com>2009-10-17 19:18:18 -0500
commitcc0103fe833d556e750fd040e34cf0165c3c7ccc (patch)
tree53fd67074a224a582fff63f9acfcedd3ed9be215
parente900a8437a6f1dcbf993dfbb1b82ee51a11128b4 (diff)
downloadrails-cc0103fe833d556e750fd040e34cf0165c3c7ccc.tar.gz
rails-cc0103fe833d556e750fd040e34cf0165c3c7ccc.tar.bz2
rails-cc0103fe833d556e750fd040e34cf0165c3c7ccc.zip
Fix brittle query string comparisons
-rw-r--r--actionpack/test/controller/url_rewriter_test.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/test/controller/url_rewriter_test.rb b/actionpack/test/controller/url_rewriter_test.rb
index 4c4bf9ade4..d81ced96a8 100644
--- a/actionpack/test/controller/url_rewriter_test.rb
+++ b/actionpack/test/controller/url_rewriter_test.rb
@@ -321,8 +321,8 @@ class UrlWriterTests < ActionController::TestCase
params = extract_params(url)
assert_equal params[0], { 'query[hobby]' => 'piercing' }.to_query
assert_equal params[1], { 'query[person][name]' => 'Bob' }.to_query
- assert_equal params[2], { 'query[person][position][]' => 'prof' }.to_query
- assert_equal params[3], { 'query[person][position][]' => 'art director' }.to_query
+ assert_equal params[2], { 'query[person][position][]' => 'art director' }.to_query
+ assert_equal params[3], { 'query[person][position][]' => 'prof' }.to_query
end
def test_path_generation_for_symbol_parameter_keys
@@ -359,10 +359,10 @@ class UrlWriterTests < ActionController::TestCase
controller = kls.new
params = {:id => 1, :format => :xml}
assert_deprecated do
- assert_equal("/posts/1.xml", controller.send(:formatted_post_path, params))
+ assert_equal("/posts/1.xml", controller.send(:formatted_post_path, params))
end
assert_deprecated do
- assert_equal("/posts/1.xml", controller.send(:formatted_post_path, 1, :xml))
+ assert_equal("/posts/1.xml", controller.send(:formatted_post_path, 1, :xml))
end
end
end
@@ -382,6 +382,6 @@ class UrlWriterTests < ActionController::TestCase
private
def extract_params(url)
- url.split('?', 2).last.split('&')
+ url.split('?', 2).last.split('&').sort
end
end