aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_many_through_associations_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-08-02 15:29:47 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-08-02 15:29:57 -0700
commit7fc3ca5fadecd4c6c506078281f556c28a5c382d (patch)
tree0330cb2fd7292ac425ccafe36049e5dbab23b837 /activerecord/test/cases/associations/has_many_through_associations_test.rb
parent77384c86f9c6ded662cea68b35d0a53c4f609aa1 (diff)
downloadrails-7fc3ca5fadecd4c6c506078281f556c28a5c382d.tar.gz
rails-7fc3ca5fadecd4c6c506078281f556c28a5c382d.tar.bz2
rails-7fc3ca5fadecd4c6c506078281f556c28a5c382d.zip
add a test for concat on hm:t associations
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 85296a5a83..724d1cbbf8 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -91,6 +91,13 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
end
end
+ def test_concat
+ person = people(:david)
+ post = posts(:thinking)
+ post.people.concat [person]
+ assert_equal 1, post.people.size
+ assert_equal 1, post.people(true).size
+ end
def test_associate_existing_record_twice_should_add_to_target_twice
post = posts(:thinking)