diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-03-28 11:55:01 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-03-28 11:55:01 +0000 |
commit | 533da24bbce5c6eeb23ff372fa0b65911fc138d0 (patch) | |
tree | 857e04c8ef0f0969753d3724fba938d2579c1034 /activerecord/test | |
parent | c62db052a0c188c405ad97abec9dd2cec2b9b1d8 (diff) | |
download | rails-533da24bbce5c6eeb23ff372fa0b65911fc138d0.tar.gz rails-533da24bbce5c6eeb23ff372fa0b65911fc138d0.tar.bz2 rails-533da24bbce5c6eeb23ff372fa0b65911fc138d0.zip |
Make sure ActiveRecord tests can run individually. Closes #11425 [thechrisoshow, h-lame]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9109 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 2 | ||||
-rwxr-xr-x | activerecord/test/cases/associations_test.rb | 2 | ||||
-rwxr-xr-x | activerecord/test/cases/base_test.rb | 5 | ||||
-rwxr-xr-x | activerecord/test/cases/fixtures_test.rb | 12 |
4 files changed, 18 insertions, 3 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 1bbc68522f..0bc345428f 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -13,7 +13,7 @@ require 'models/pet' class EagerAssociationTest < ActiveRecord::TestCase fixtures :posts, :comments, :authors, :categories, :categories_posts, :companies, :accounts, :tags, :taggings, :people, :readers, - :owners, :pets + :owners, :pets, :author_favorites def test_loading_with_one_association posts = Post.find(:all, :include => :comments) diff --git a/activerecord/test/cases/associations_test.rb b/activerecord/test/cases/associations_test.rb index 602fc18ab7..0a05bd0e56 100755 --- a/activerecord/test/cases/associations_test.rb +++ b/activerecord/test/cases/associations_test.rb @@ -1328,7 +1328,7 @@ end class BelongsToAssociationsTest < ActiveRecord::TestCase fixtures :accounts, :companies, :developers, :projects, :topics, - :developers_projects, :computers, :authors, :posts, :tags, :taggings + :developers_projects, :computers, :authors, :posts, :tags, :taggings, :comments def test_belongs_to Client.find(3).firm.name diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 025858bf15..3bf0ef1a56 100755 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1,6 +1,8 @@ require "cases/helper" +require 'models/author' require 'models/topic' require 'models/reply' +require 'models/category' require 'models/company' require 'models/customer' require 'models/developer' @@ -11,6 +13,7 @@ require 'models/column_name' require 'models/subscriber' require 'models/keyboard' require 'models/post' +require 'models/comment' require 'models/minimalistic' require 'models/warehouse_thing' require 'rexml/document' @@ -72,7 +75,7 @@ class TopicWithProtectedContentAndAccessibleAuthorName < ActiveRecord::Base end class BasicsTest < ActiveRecord::TestCase - fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics, 'warehouse-things' + fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics, 'warehouse-things', :authors def test_table_exists assert !NonExistentTable.table_exists? diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index e30035e79e..fd7bc75471 100755 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -358,6 +358,9 @@ end class SetTableNameFixturesTest < ActiveRecord::TestCase set_fixture_class :funny_jokes => 'Joke' fixtures :funny_jokes + # Set to false to blow away fixtures cache and ensure our fixtures are loaded + # and thus takes into account our set_fixture_class + self.use_transactional_fixtures = false def test_table_method assert_kind_of Joke, funny_jokes(:a_joke) @@ -367,6 +370,9 @@ end class CustomConnectionFixturesTest < ActiveRecord::TestCase set_fixture_class :courses => Course fixtures :courses + # Set to false to blow away fixtures cache and ensure our fixtures are loaded + # and thus takes into account our set_fixture_class + self.use_transactional_fixtures = false def test_connection assert_kind_of Course, courses(:ruby) @@ -376,6 +382,9 @@ end class InvalidTableNameFixturesTest < ActiveRecord::TestCase fixtures :funny_jokes + # Set to false to blow away fixtures cache and ensure our fixtures are loaded + # and thus takes into account our lack of set_fixture_class + self.use_transactional_fixtures = false def test_raises_error assert_raises FixtureClassNotFound do @@ -387,6 +396,9 @@ end class CheckEscapedYamlFixturesTest < ActiveRecord::TestCase set_fixture_class :funny_jokes => 'Joke' fixtures :funny_jokes + # Set to false to blow away fixtures cache and ensure our fixtures are loaded + # and thus takes into account our set_fixture_class + self.use_transactional_fixtures = false def test_proper_escaped_fixture assert_equal "The \\n Aristocrats\nAte the candy\n", funny_jokes(:another_joke).name |