aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-08-13 21:42:10 +0930
committerGitHub <noreply@github.com>2017-08-13 21:42:10 +0930
commit6dc9c91c82204526017b4c024f88ac60b81879b9 (patch)
treea69042e5984dee22addea83c5c9fcd30e8cf94a3 /activerecord/test
parent4ec5b7610dc040c616b6d058cc23c5af887ec221 (diff)
parent625bdb164ed7cb06dd88bec57c338b63460628d7 (diff)
downloadrails-6dc9c91c82204526017b4c024f88ac60b81879b9.tar.gz
rails-6dc9c91c82204526017b4c024f88ac60b81879b9.tar.bz2
rails-6dc9c91c82204526017b4c024f88ac60b81879b9.zip
Merge pull request #30228 from kamipo/fix_random_ci_failure
Fix random CI failure due to non-deterministic sorting order
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/scoping/named_scoping_test.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/cases/scoping/named_scoping_test.rb b/activerecord/test/cases/scoping/named_scoping_test.rb
index 1db7432e34..b0431a4e34 100644
--- a/activerecord/test/cases/scoping/named_scoping_test.rb
+++ b/activerecord/test/cases/scoping/named_scoping_test.rb
@@ -117,7 +117,8 @@ class NamedScopingTest < ActiveRecord::TestCase
assert_not_equal Post.containing_the_letter_a, authors(:david).posts
assert !Post.containing_the_letter_a.empty?
- assert_equal authors(:david).posts & Post.containing_the_letter_a, authors(:david).posts.containing_the_letter_a
+ expected = authors(:david).posts & Post.containing_the_letter_a
+ assert_equal expected.sort_by(&:id), authors(:david).posts.containing_the_letter_a.sort_by(&:id)
end
def test_scope_with_STI
@@ -129,7 +130,8 @@ class NamedScopingTest < ActiveRecord::TestCase
assert_not_equal Comment.containing_the_letter_e, authors(:david).comments
assert !Comment.containing_the_letter_e.empty?
- assert_equal authors(:david).comments & Comment.containing_the_letter_e, authors(:david).comments.containing_the_letter_e
+ expected = authors(:david).comments & Comment.containing_the_letter_e
+ assert_equal expected.sort_by(&:id), authors(:david).comments.containing_the_letter_e.sort_by(&:id)
end
def test_scopes_honor_current_scopes_from_when_defined