Permalink
Browse files

A failing test for a nested has many through association loaded via F…

…oo.joins(:bar)
  • Loading branch information...
1 parent 4371108 commit 3cc35633872a0072764d8edb20f1fc4e14adf729 @jonleighton jonleighton committed Oct 5, 2010
@@ -45,4 +45,10 @@ def test_nested_has_many_through_with_a_table_referenced_multiple_times
author = authors(:bob)
assert_equal [posts(:misc_by_bob), posts(:misc_by_mary)], author.similar_posts.sort_by(&:id)
end
+
+ def test_nested_has_many_through_as_a_join
+ # All authors with subscribers where one of the subscribers' nick is 'alterself'
+ authors = Author.joins(:subscribers).where('subscribers.nick' => 'alterself')
+ assert_equal [authors(:david)], authors
+ end
end

0 comments on commit 3cc3563

Please sign in to comment.