Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

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)

More fixes to missing fixtures.

  • test/cases/associations_test.rb

    old new  
    13281328 
    13291329class BelongsToAssociationsTest < ActiveRecord::TestCase 
    13301330  fixtures :accounts, :companies, :developers, :projects, :topics, 
    1331            :developers_projects, :computers, :authors, :posts, :tags, :taggings 
     1331           :developers_projects, :computers, :authors, :posts, :tags, :taggings, :comments 
    13321332 
    13331333  def test_belongs_to 
    13341334    Client.find(3).firm.name 
  • test/cases/fixtures_test.rb

    old new  
    358358class SetTableNameFixturesTest < ActiveRecord::TestCase 
    359359  set_fixture_class :funny_jokes => 'Joke' 
    360360  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 
    361364 
    362365  def test_table_method 
    363366    assert_kind_of Joke, funny_jokes(:a_joke) 
     
    367370class CustomConnectionFixturesTest < ActiveRecord::TestCase 
    368371  set_fixture_class :courses => Course 
    369372  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 
    370376 
    371377  def test_connection 
    372378    assert_kind_of Course, courses(:ruby) 
     
    376382 
    377383class InvalidTableNameFixturesTest < ActiveRecord::TestCase 
    378384  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 
    379388 
    380389  def test_raises_error 
    381390    assert_raises FixtureClassNotFound do 
     
    387396class CheckEscapedYamlFixturesTest < ActiveRecord::TestCase 
    388397  set_fixture_class :funny_jokes => 'Joke' 
    389398  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 
    390402 
    391403  def test_proper_escaped_fixture 
    392404    assert_equal "The \\n Aristocrats\nAte the candy\n", funny_jokes(:another_joke).name 
  • test/cases/base_test.rb

    old new  
    11require "cases/helper" 
     2require 'models/author'  
    23require 'models/topic' 
    34require 'models/reply' 
     5require 'models/category'  
    46require 'models/company' 
    57require 'models/customer' 
    68require 'models/developer' 
     
    1113require 'models/subscriber' 
    1214require 'models/keyboard' 
    1315require 'models/post' 
     16require 'models/comment' 
    1417require 'models/minimalistic' 
    1518require 'models/warehouse_thing' 
    1619require 'rexml/document' 
     
    7275end 
    7376 
    7477class 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 
    7679 
    7780  def test_table_exists 
    7881    assert !NonExistentTable.table_exists? 
  • test/cases/associations/eager_test.rb

    old new  
    1313class EagerAssociationTest < ActiveRecord::TestCase 
    1414  fixtures :posts, :comments, :authors, :categories, :categories_posts, 
    1515            :companies, :accounts, :tags, :taggings, :people, :readers, 
    16             :owners, :pets 
     16            :owners, :pets, :author_favorites 
    1717 
    1818  def test_loading_with_one_association 
    1919    posts = Post.find(:all, :include => :comments) 
  • RUNNING_UNIT_TESTS

    old new  
    2525Unit tests are located in test/cases directory. If you only want to run a single test suite,  
    2626you can do so with: 
    2727 
    28    rake test_mysql TEST=base_test.rb 
     28   rake test_mysql TEST=test/cases/base_test.rb 
    2929    
    3030That'll run the base suite using the MySQL-Ruby adapter. 
    3131