From 3c9cd19786b1e74114d933594225f2fa37407be2 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Wed, 31 Oct 2007 05:43:52 +0000 Subject: Make fixtures work with the new test subclasses. [tarmo, Koz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8060 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/abstract_unit.rb | 1 + activerecord/test/fixtures_test.rb | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'activerecord/test') diff --git a/activerecord/test/abstract_unit.rb b/activerecord/test/abstract_unit.rb index 9d8adf2509..a09c8daad5 100755 --- a/activerecord/test/abstract_unit.rb +++ b/activerecord/test/abstract_unit.rb @@ -4,6 +4,7 @@ $:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib') require 'test/unit' require 'active_record' require 'active_record/fixtures' +require 'active_support/test_case' require 'connection' # Show backtraces for deprecated behavior for quicker cleanup. diff --git a/activerecord/test/fixtures_test.rb b/activerecord/test/fixtures_test.rb index 2bc72d0b4e..40790a607d 100755 --- a/activerecord/test/fixtures_test.rb +++ b/activerecord/test/fixtures_test.rb @@ -417,7 +417,7 @@ class FixturesBrokenRollbackTest < Test::Unit::TestCase end class LoadAllFixturesTest < Test::Unit::TestCase - write_inheritable_attribute :fixture_path, File.join(File.dirname(__FILE__), '/fixtures/all') + self.fixture_path= File.join(File.dirname(__FILE__), '/fixtures/all') fixtures :all def test_all_there @@ -529,3 +529,13 @@ class FoxyFixturesTest < Test::Unit::TestCase assert_equal("frederick", parrots(:frederick).name) end end + +class ActiveSupportSubclassWithFixturesTest < ActiveSupport::TestCase + fixtures :parrots + + # This seemingly useless assertion catches a bug that caused the fixtures + # setup code call nil[] + def test_foo + assert_equal parrots(:louis), Parrot.find_by_name("King Louis") + end +end \ No newline at end of file -- cgit v1.2.3