1
0
Fork 0
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:
Emilio Tagua 2009-05-18 20:17:35 -03:00 committed by Pratik Naik
parent 07f733c631
commit 20deb677a2
3 changed files with 32 additions and 25 deletions

View file

@ -13,7 +13,7 @@ require 'models/pet'
require 'models/toy' require 'models/toy'
class HasManyThroughAssociationsTest < ActiveRecord::TestCase 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 def test_associate_existing
assert_queries(2) { posts(:thinking);people(:david) } assert_queries(2) { posts(:thinking);people(:david) }

View file

@ -12,6 +12,7 @@ require 'models/reader'
require 'models/ship' require 'models/ship'
require 'models/ship_part' require 'models/ship_part'
require 'models/treasure' require 'models/treasure'
require 'models/company'
class TestAutosaveAssociationsInGeneral < ActiveRecord::TestCase class TestAutosaveAssociationsInGeneral < ActiveRecord::TestCase
def test_autosave_should_be_a_valid_option_for_has_one def test_autosave_should_be_a_valid_option_for_has_one
@ -38,6 +39,8 @@ class TestAutosaveAssociationsInGeneral < ActiveRecord::TestCase
end end
class TestDefaultAutosaveAssociationOnAHasOneAssociation < ActiveRecord::TestCase class TestDefaultAutosaveAssociationOnAHasOneAssociation < ActiveRecord::TestCase
fixtures :companies, :accounts
def test_should_save_parent_but_not_invalid_child def test_should_save_parent_but_not_invalid_child
firm = Firm.new(:name => 'GlobalMegaCorp') firm = Firm.new(:name => 'GlobalMegaCorp')
assert firm.valid? assert firm.valid?
@ -137,6 +140,8 @@ class TestDefaultAutosaveAssociationOnAHasOneAssociation < ActiveRecord::TestCas
end end
class TestDefaultAutosaveAssociationOnABelongsToAssociation < ActiveRecord::TestCase class TestDefaultAutosaveAssociationOnABelongsToAssociation < ActiveRecord::TestCase
fixtures :companies
def test_should_save_parent_but_not_invalid_child def test_should_save_parent_but_not_invalid_child
client = Client.new(:name => 'Joe (the Plumber)') client = Client.new(:name => 'Joe (the Plumber)')
assert client.valid? assert client.valid?

View file

@ -387,6 +387,8 @@ class DynamicScopeMatchTest < ActiveRecord::TestCase
end end
class DynamicScopeTest < ActiveRecord::TestCase class DynamicScopeTest < ActiveRecord::TestCase
fixtures :posts
def test_dynamic_scope def test_dynamic_scope
assert_equal Post.scoped_by_author_id(1).find(1), Post.find(1) 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"}) 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"})