diff options
author | Michael Koziarski <michael@koziarski.com> | 2007-10-31 05:43:52 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2007-10-31 05:43:52 +0000 |
commit | 3c9cd19786b1e74114d933594225f2fa37407be2 (patch) | |
tree | 6718d13f9f3e7294034e74899f6567e24f5e5fad /activerecord/test | |
parent | e86d1decc185679ec6303f0ea5c25fdc30b57a71 (diff) | |
download | rails-3c9cd19786b1e74114d933594225f2fa37407be2.tar.gz rails-3c9cd19786b1e74114d933594225f2fa37407be2.tar.bz2 rails-3c9cd19786b1e74114d933594225f2fa37407be2.zip |
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
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/abstract_unit.rb | 1 | ||||
-rwxr-xr-x | activerecord/test/fixtures_test.rb | 12 |
2 files changed, 12 insertions, 1 deletions
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 |