diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-08-09 12:59:49 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-08-09 13:08:50 +0300 |
commit | 93c65ae4efd62933618193c088ed1dadef47793d (patch) | |
tree | 9234b1abbba8219e724c5949cd4b4791f3ce0a96 | |
parent | da589fcc4a15cdc923b9df55f9fe964df996e49b (diff) | |
download | rails-93c65ae4efd62933618193c088ed1dadef47793d.tar.gz rails-93c65ae4efd62933618193c088ed1dadef47793d.tar.bz2 rails-93c65ae4efd62933618193c088ed1dadef47793d.zip |
Fix random CI failure due to non-deterministic sorting order
```
rails/activerecord$ bundle exec rake postgresql:test --verbose TESTOPTS="--seed=36062"
Failure:
AssociationsJoinModelTest#test_has_many_through_polymorphic_has_one
[/home/travis/build/rails/rails/activerecord/test/cases/associations/join_model_test.rb:407]:
--- expected
+++ actual
@@ -1 +1 @@
-[
#<Tagging id: 1, tag_id: 1, super_tag_id: 2, taggable_type: "Post", taggable_id: 1, comment: nil>,
#<Tagging id: 2, tag_id: 1, super_tag_id: nil, taggable_type: "Post", taggable_id: 2, comment: nil>
]
+#<ActiveRecord::Associations::CollectionProxy [
#<Tagging id: 2, tag_id: 1, super_tag_id: nil, taggable_type: "Post", taggable_id: 2, comment: nil>,
#<Tagging id: 1, tag_id: 1, super_tag_id: 2, taggable_type: "Post", taggable_id: 1, comment: nil>
]>
```
-rw-r--r-- | activerecord/test/cases/associations/join_model_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb index 2f68bc5141..9d3d5353ff 100644 --- a/activerecord/test/cases/associations/join_model_test.rb +++ b/activerecord/test/cases/associations/join_model_test.rb @@ -404,7 +404,7 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase end def test_has_many_through_polymorphic_has_one - assert_equal Tagging.find(1, 2).sort_by(&:id), authors(:david).taggings_2 + assert_equal Tagging.find(1, 2).sort_by(&:id), authors(:david).taggings_2.sort_by(&:id) end def test_has_many_through_polymorphic_has_many |