1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/test/core_ext/object
Edouard CHIN 48b6bacbc5 e4e1b62 broke to_param handling:
- There was an issue inside controller tests where order params were not respected, the reason
  was because we were calling `Hash#to_query` which sorts the results lexicographically.
  1e4e1b62 fixed that issue by not using `to_query` but instead a utility function provided by rack.
- However with the fix came another issue where it's now no longer possible to do this

  ```
   post :foo, params: { user: User.first }

   # Prior to the patch the controller will receive { "user" => "1" }
   # Whereas now you get { "user": "#<User: ...>" }
  ```

  The fix in this PR is to modify `Hash#to_query` to sort only when it
  doesn't contain an array structure that looks something like "bar[]"

  Ref https://github.com/rails/rails/pull/33341#issuecomment-404039396
2018-07-12 13:04:27 -04:00
..
acts_like_test.rb Replace assert ! with assert_not 2018-04-19 08:11:33 -04:00
blank_test.rb Merge pull request #31648 from dixitp012/rubocop_active_support_test 2018-01-08 15:14:14 +09:00
deep_dup_test.rb Replace assert ! with assert_not 2018-04-19 08:11:33 -04:00
duplicable_test.rb Fix CustomCops/AssertNot to allow it to have failure message 2018-05-13 11:32:47 +09:00
inclusion_test.rb Replace assert ! with assert_not 2018-04-19 08:11:33 -04:00
instance_variables_test.rb These strings should already be frozen where ruby accepts the magic-comment 2017-11-15 17:21:05 +09:00
json_cherry_pick_test.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
json_gem_encoding_test.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
to_param_test.rb [Active Support] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
to_query_test.rb e4e1b62 broke to_param handling: 2018-07-12 13:04:27 -04:00
try_test.rb Use try in tests that try to test try. 2018-03-21 21:02:36 +01:00