Skip to content

Instantly share code, notes, and snippets.

@senny
Created October 22, 2013 13:46
Show Gist options
  • Save senny/7101073 to your computer and use it in GitHub Desktop.
Save senny/7101073 to your computer and use it in GitHub Desktop.
43dd92b (HEAD, stable_test_fix) TMP [Yves Senn] [6 hours ago]
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index 9a4a07d..70d3fbf 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -634,21 +634,21 @@ class RelationTest < ActiveRecord::TestCase
def test_find_all_using_where_with_relation_with_bound_values
david = authors(:david)
- davids_posts = david.posts.to_a
+ davids_posts = david.posts.to_a.sort_by(&:id)
assert_queries(1) do
relation = Post.where(id: david.posts.select(:id))
- assert_equal davids_posts, relation.to_a
+ assert_equal davids_posts, relation.to_a.sort_by(&:id)
end
assert_queries(1) do
relation = Post.where('id in (?)', david.posts.select(:id))
- assert_equal davids_posts, relation.to_a, 'should process Relation as bind variables'
+ assert_equal davids_posts, relation.to_a.sort_by(&:id), 'should process Relation as bind variables'
end
assert_queries(1) do
relation = Post.where('id in (:post_ids)', post_ids: david.posts.select(:id))
- assert_equal davids_posts, relation.to_a, 'should process Relation as named bind variables'
+ assert_equal davids_posts, relation.to_a.sort_by(&:id), 'should process Relation as named bind variables'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment