1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

add a test for concat on hm:t associations

This commit is contained in:
Aaron Patterson 2013-08-02 15:29:47 -07:00
parent 77384c86f9
commit 7fc3ca5fad

View file

@ -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)