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:
parent
77384c86f9
commit
7fc3ca5fad
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue