mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Added some has_many tests
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
parent
ca9641f8a7
commit
d0b3685a0e
1 changed files with 3 additions and 3 deletions
|
@ -37,15 +37,15 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
|
|||
end
|
||||
|
||||
def test_counting_with_single_conditions
|
||||
assert_equal 2, Firm.find(:first).plain_clients.count(:conditions => '1=1')
|
||||
assert_equal 1, Firm.find(:first).plain_clients.count(:conditions => 'name="Microsoft"')
|
||||
end
|
||||
|
||||
def test_counting_with_single_hash
|
||||
assert_equal 2, Firm.find(:first).plain_clients.count(:conditions => '1=1')
|
||||
assert_equal 1, Firm.find(:first).plain_clients.count(:conditions => {:name => "Microsoft"})
|
||||
end
|
||||
|
||||
def test_counting_with_column_name_and_hash
|
||||
assert_equal 2, Firm.find(:first).plain_clients.count(:all, :conditions => '1=1')
|
||||
assert_equal 2, Firm.find(:first).plain_clients.count(:name)
|
||||
end
|
||||
|
||||
def test_finding
|
||||
|
|
Loading…
Reference in a new issue