Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[Rails2.3] Tests helper compatible with 2.3

  • Loading branch information...
commit 25fc25bc9b37f5b5c8179ff7c9bf34f8010feaa6 1 parent d2b46a2
Ken Collins authored

Showing 2 changed files with 13 additions and 0 deletions. Show diff stats Hide diff stats

  1. +12 0 test/helper.rb
  2. +1 0  test/lib/boot.rb
12 test/helper.rb
@@ -2,6 +2,18 @@
2 2 require File.join(File.dirname(__FILE__),'lib/boot') unless defined?(ActiveRecord)
3 3 require 'acts_as_versioned'
4 4
  5 +if ActiveRecord::VERSION::STRING >= '2.3.0'
  6 + class ActiveSupport::TestCase
  7 + include ActiveRecord::TestFixtures
  8 + self.fixture_path = FIXTURES_ROOT
  9 + self.use_instantiated_fixtures = false
  10 + self.use_transactional_fixtures = true
  11 + def create_fixtures(*table_names, &block)
  12 + Fixtures.create_fixtures(ActiveSupport::TestCase.fixture_path, table_names, {}, &block)
  13 + end
  14 + end
  15 +end
  16 +
5 17 class AAVTestCase < ActiveRecord::TestCase
6 18
7 19 self.use_transactional_fixtures = true
1  test/lib/boot.rb
@@ -23,6 +23,7 @@
23 23
24 24 require 'active_record/fixtures'
25 25 require 'active_record/test_case'
  26 +require 'active_record/version'
26 27
27 28
28 29 # Establishing the ActiveRecord connection and DB specific tasks.

0 comments on commit 25fc25b

Please sign in to comment.
Something went wrong with that request. Please try again.