Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix brittle query string comparisons

  • Loading branch information...
commit cc0103fe833d556e750fd040e34cf0165c3c7ccc 1 parent e900a84
@josh josh authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 actionpack/test/controller/url_rewriter_test.rb
View
10 actionpack/test/controller/url_rewriter_test.rb
@@ -321,8 +321,8 @@ def test_hash_recursive_and_array_parameters
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 @@ def test_formatted_url_methods_are_deprecated
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 @@ def test_multiple_includes_maintain_distinct_options
private
def extract_params(url)
- url.split('?', 2).last.split('&')
+ url.split('?', 2).last.split('&').sort
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.