Ticket #11425: more_fixes_for_active_record_test_run_by_hand.diff
| File more_fixes_for_active_record_test_run_by_hand.diff, 4.4 kB (added by h-lame, 8 months ago) |
|---|
-
test/cases/associations_test.rb
old new 1328 1328 1329 1329 class BelongsToAssociationsTest < ActiveRecord::TestCase 1330 1330 fixtures :accounts, :companies, :developers, :projects, :topics, 1331 :developers_projects, :computers, :authors, :posts, :tags, :taggings 1331 :developers_projects, :computers, :authors, :posts, :tags, :taggings, :comments 1332 1332 1333 1333 def test_belongs_to 1334 1334 Client.find(3).firm.name -
test/cases/fixtures_test.rb
old new 358 358 class SetTableNameFixturesTest < ActiveRecord::TestCase 359 359 set_fixture_class :funny_jokes => 'Joke' 360 360 fixtures :funny_jokes 361 # Set to false to blow away fixtures cache and ensure our fixtures are loaded 362 # and thus takes into account our set_fixture_class 363 self.use_transactional_fixtures = false 361 364 362 365 def test_table_method 363 366 assert_kind_of Joke, funny_jokes(:a_joke) … … 367 370 class CustomConnectionFixturesTest < ActiveRecord::TestCase 368 371 set_fixture_class :courses => Course 369 372 fixtures :courses 373 # Set to false to blow away fixtures cache and ensure our fixtures are loaded 374 # and thus takes into account our set_fixture_class 375 self.use_transactional_fixtures = false 370 376 371 377 def test_connection 372 378 assert_kind_of Course, courses(:ruby) … … 376 382 377 383 class InvalidTableNameFixturesTest < ActiveRecord::TestCase 378 384 fixtures :funny_jokes 385 # Set to false to blow away fixtures cache and ensure our fixtures are loaded 386 # and thus takes into account our lack of set_fixture_class 387 self.use_transactional_fixtures = false 379 388 380 389 def test_raises_error 381 390 assert_raises FixtureClassNotFound do … … 387 396 class CheckEscapedYamlFixturesTest < ActiveRecord::TestCase 388 397 set_fixture_class :funny_jokes => 'Joke' 389 398 fixtures :funny_jokes 399 # Set to false to blow away fixtures cache and ensure our fixtures are loaded 400 # and thus takes into account our set_fixture_class 401 self.use_transactional_fixtures = false 390 402 391 403 def test_proper_escaped_fixture 392 404 assert_equal "The \\n Aristocrats\nAte the candy\n", funny_jokes(:another_joke).name -
test/cases/base_test.rb
old new 1 1 require "cases/helper" 2 require 'models/author' 2 3 require 'models/topic' 3 4 require 'models/reply' 5 require 'models/category' 4 6 require 'models/company' 5 7 require 'models/customer' 6 8 require 'models/developer' … … 11 13 require 'models/subscriber' 12 14 require 'models/keyboard' 13 15 require 'models/post' 16 require 'models/comment' 14 17 require 'models/minimalistic' 15 18 require 'models/warehouse_thing' 16 19 require 'rexml/document' … … 72 75 end 73 76 74 77 class BasicsTest < ActiveRecord::TestCase 75 fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics, 'warehouse-things' 78 fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics, 'warehouse-things', :authors 76 79 77 80 def test_table_exists 78 81 assert !NonExistentTable.table_exists? -
test/cases/associations/eager_test.rb
old new 13 13 class EagerAssociationTest < ActiveRecord::TestCase 14 14 fixtures :posts, :comments, :authors, :categories, :categories_posts, 15 15 :companies, :accounts, :tags, :taggings, :people, :readers, 16 :owners, :pets 16 :owners, :pets, :author_favorites 17 17 18 18 def test_loading_with_one_association 19 19 posts = Post.find(:all, :include => :comments) -
RUNNING_UNIT_TESTS
old new 25 25 Unit tests are located in test/cases directory. If you only want to run a single test suite, 26 26 you can do so with: 27 27 28 rake test_mysql TEST= base_test.rb28 rake test_mysql TEST=test/cases/base_test.rb 29 29 30 30 That'll run the base suite using the MySQL-Ruby adapter. 31 31