aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-07-14 23:00:08 -0300
committerEmilio Tagua <miloops@gmail.com>2009-07-14 23:00:08 -0300
commit634f6713ee15c6fd958bafc7a3422acac2e3343f (patch)
tree0df11ceb12f9911ad16c950802af1e5874c89ab4 /activerecord/test/cases/associations
parentfb46d00fdfa724dc0c252a46ec13c4ee4cda4708 (diff)
parent40b387580ff251e06632fbcc87c2a78c027a6b27 (diff)
downloadrails-634f6713ee15c6fd958bafc7a3422acac2e3343f.tar.gz
rails-634f6713ee15c6fd958bafc7a3422acac2e3343f.tar.bz2
rails-634f6713ee15c6fd958bafc7a3422acac2e3343f.zip
Merge commit 'rails/master'
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb
index 7a4712d7c8..8529ff0285 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -243,8 +243,12 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
assert_equal 2, people(:michael).jobs.size
end
- def test_get_ids
- assert_equal [posts(:welcome).id, posts(:authorless).id].sort, people(:michael).post_ids.sort
+ def test_get_ids_for_belongs_to_source
+ assert_sql(/DISTINCT/) { assert_equal [posts(:welcome).id, posts(:authorless).id].sort, people(:michael).post_ids.sort }
+ end
+
+ def test_get_ids_for_has_many_source
+ assert_equal [comments(:eager_other_comment1).id], authors(:mary).comment_ids
end
def test_get_ids_for_loaded_associations