Permalink
Browse files

Fix for default_scope tests to ensure comparing of equally sorted lists

This is additional fix for commit
ebc4746 Respect the default_scope on a join model when reading a through association
which otherwise was failing on Oracle (as it returned fixture comments in different order).
  • Loading branch information...
1 parent c7f81f1 commit d9c8c47e3db89ca75de6ae9a8497659378ef0c1d @rsim rsim committed with tenderlove Dec 23, 2010
@@ -466,7 +466,7 @@ def test_size_of_through_association_should_increase_correctly_when_has_many_ass
end
def test_has_many_through_with_default_scope_on_join_model
- assert_equal posts(:welcome).comments, authors(:david).comments_on_first_posts
+ assert_equal posts(:welcome).comments.order('id').all, authors(:david).comments_on_first_posts
end
def test_create_has_many_through_with_default_scope_on_join_model
@@ -235,6 +235,6 @@ def test_value_is_properly_quoted
end
def test_has_one_through_with_default_scope_on_join_model
- assert_equal posts(:welcome).comments.first, authors(:david).comment_on_first_posts
+ assert_equal posts(:welcome).comments.order('id').first, authors(:david).comment_on_first_posts
end
end

1 comment on commit d9c8c47

Member

jonleighton commented on d9c8c47 Dec 23, 2010

Oops, my bad, thanks. The commit number referenced is incorrect though - it's eba7664

Please sign in to comment.