mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix HasManyThroughAssociationsTest tests. [#733 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
parent
108db00aa9
commit
fb5cc19707
1 changed files with 6 additions and 3 deletions
|
@ -2,15 +2,18 @@ require "cases/helper"
|
|||
require 'models/post'
|
||||
require 'models/person'
|
||||
require 'models/reader'
|
||||
require 'models/comment'
|
||||
|
||||
class HasManyThroughAssociationsTest < ActiveRecord::TestCase
|
||||
fixtures :posts, :readers, :people
|
||||
fixtures :posts, :readers, :people, :comments
|
||||
|
||||
def test_associate_existing
|
||||
assert_queries(2) { posts(:thinking);people(:david) }
|
||||
|
||||
|
||||
posts(:thinking).people
|
||||
|
||||
assert_queries(1) do
|
||||
posts(:thinking).people << people(:david)
|
||||
posts(:thinking).people << people(:david)
|
||||
end
|
||||
|
||||
assert_queries(1) do
|
||||
|
|
Loading…
Reference in a new issue