mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add missing models and fixtures [#2673 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
parent
07f733c631
commit
20deb677a2
3 changed files with 32 additions and 25 deletions
|
@ -13,7 +13,7 @@ require 'models/pet'
|
|||
require 'models/toy'
|
||||
|
||||
class HasManyThroughAssociationsTest < ActiveRecord::TestCase
|
||||
fixtures :posts, :readers, :people, :comments, :authors, :owners, :pets, :toys
|
||||
fixtures :posts, :readers, :people, :comments, :authors, :owners, :pets, :toys, :jobs, :references
|
||||
|
||||
def test_associate_existing
|
||||
assert_queries(2) { posts(:thinking);people(:david) }
|
||||
|
|
|
@ -12,6 +12,7 @@ require 'models/reader'
|
|||
require 'models/ship'
|
||||
require 'models/ship_part'
|
||||
require 'models/treasure'
|
||||
require 'models/company'
|
||||
|
||||
class TestAutosaveAssociationsInGeneral < ActiveRecord::TestCase
|
||||
def test_autosave_should_be_a_valid_option_for_has_one
|
||||
|
@ -38,6 +39,8 @@ class TestAutosaveAssociationsInGeneral < ActiveRecord::TestCase
|
|||
end
|
||||
|
||||
class TestDefaultAutosaveAssociationOnAHasOneAssociation < ActiveRecord::TestCase
|
||||
fixtures :companies, :accounts
|
||||
|
||||
def test_should_save_parent_but_not_invalid_child
|
||||
firm = Firm.new(:name => 'GlobalMegaCorp')
|
||||
assert firm.valid?
|
||||
|
@ -137,6 +140,8 @@ class TestDefaultAutosaveAssociationOnAHasOneAssociation < ActiveRecord::TestCas
|
|||
end
|
||||
|
||||
class TestDefaultAutosaveAssociationOnABelongsToAssociation < ActiveRecord::TestCase
|
||||
fixtures :companies
|
||||
|
||||
def test_should_save_parent_but_not_invalid_child
|
||||
client = Client.new(:name => 'Joe (the Plumber)')
|
||||
assert client.valid?
|
||||
|
|
|
@ -387,6 +387,8 @@ class DynamicScopeMatchTest < ActiveRecord::TestCase
|
|||
end
|
||||
|
||||
class DynamicScopeTest < ActiveRecord::TestCase
|
||||
fixtures :posts
|
||||
|
||||
def test_dynamic_scope
|
||||
assert_equal Post.scoped_by_author_id(1).find(1), Post.find(1)
|
||||
assert_equal Post.scoped_by_author_id_and_title(1, "Welcome to the weblog").first, Post.find(:first, :conditions => { :author_id => 1, :title => "Welcome to the weblog"})
|
||||
|
|
Loading…
Reference in a new issue