diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-11-26 22:46:11 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-11-26 22:46:11 +0000 |
commit | c7e39691899b080a451a4c94a3632cada5ab0750 (patch) | |
tree | a8f4726cb92225a0bf7517ea666e3b644cd1cb1c /activerecord/test/fixtures_test.rb | |
parent | 8b3f83105ce719642a8f079f72c4f03c97cfc321 (diff) | |
download | rails-c7e39691899b080a451a4c94a3632cada5ab0750.tar.gz rails-c7e39691899b080a451a4c94a3632cada5ab0750.tar.bz2 rails-c7e39691899b080a451a4c94a3632cada5ab0750.zip |
Foxy fixtures: support single-table inheritance. Closes #10234.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8219 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures_test.rb')
-rwxr-xr-x | activerecord/test/fixtures_test.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/fixtures_test.rb b/activerecord/test/fixtures_test.rb index d51a4029bc..c1e79b807f 100755 --- a/activerecord/test/fixtures_test.rb +++ b/activerecord/test/fixtures_test.rb @@ -562,12 +562,17 @@ class FoxyFixturesTest < Test::Unit::TestCase assert_equal(pirates(:redbeard), treasures(:sapphire).looter) assert_equal(parrots(:louis), treasures(:ruby).looter) end - + def test_only_generates_a_pk_if_necessary m = Matey.find(:first) m.pirate = pirates(:blackbeard) m.target = pirates(:redbeard) end + + def test_supports_sti + assert_kind_of DeadParrot, parrots(:polly) + assert_equal pirates(:blackbeard), parrots(:polly).killer + end end class ActiveSupportSubclassWithFixturesTest < ActiveSupport::TestCase |