aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_many_through_associations_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-01-12 18:01:02 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-12 18:07:53 -0800
commit3165dca28c1db741994c3176e7b158a9f684e816 (patch)
tree6456a3c446fe42bdb834fd222c59c9d8e7459c5e /activerecord/test/cases/associations/has_many_through_associations_test.rb
parentf2beb56c8b14326f35af887ef0d2ee6356946065 (diff)
downloadrails-3165dca28c1db741994c3176e7b158a9f684e816.tar.gz
rails-3165dca28c1db741994c3176e7b158a9f684e816.tar.bz2
rails-3165dca28c1db741994c3176e7b158a9f684e816.zip
include_in_memory? should check against @target list in case of new records. [#6257 state:resolved]
Diffstat (limited to 'activerecord/test/cases/associations/has_many_through_associations_test.rb')
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb7
1 files changed, 7 insertions, 0 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 e98d178ff5..7235631b5a 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -32,6 +32,13 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
Reader.create :person_id => 0, :post_id => 0
end
+ def test_include?
+ person = Person.new
+ post = Post.new
+ person.posts << post
+ assert person.posts.include?(post)
+ end
+
def test_associate_existing
assert_queries(2) { posts(:thinking); people(:david) }