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

Changeset 6228

Show
Ignore:
Timestamp:
02/25/07 19:27:56 (2 years ago)
Author:
david
Message:

Setting fixtures automatically for integration tests is a bit harder -- will have to wait until the test superclass reform is implemented

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/lib/active_record/fixtures.rb

    r6227 r6228  
    491491        (table_names || fixture_table_names).each do |table_name| 
    492492          table_name = table_name.to_s.tr('.','_') 
     493 
    493494          define_method(table_name) do |fixture, *optionals| 
    494495            force_reload = optionals.shift 
    495496            @fixture_cache[table_name] ||= Hash.new 
    496497            @fixture_cache[table_name][fixture] = nil if force_reload 
     498 
    497499            if @loaded_fixtures[table_name][fixture.to_s] 
    498500              @fixture_cache[table_name][fixture] ||= @loaded_fixtures[table_name][fixture.to_s].find 
  • trunk/railties/helpers/test_helper.rb

    r6227 r6228  
    2828  # If you need to control the loading order (due to foreign key constraints etc), you'll 
    2929  # need to change this line to explicitly name the order you desire. 
     30  # 
     31  # Note: You'll currently still have to declare fixtures explicitly in integration tests 
     32  # -- they do not yet inherent this setting 
    3033  fixtures :all 
    3134