Created
October 22, 2013 13:46
-
-
Save senny/7101073 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[33m43dd92b[m[32m (HEAD, stable_test_fix)[m TMP [31m[Yves Senn][m [36m[6 hours ago][m | |
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