diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-11-25 22:08:38 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-11-25 22:08:38 +0000 |
commit | f4b5ca1ff0113e41c974b7cbda1f734f9c0526fe (patch) | |
tree | a4c8d309f2167c6874954201eb8f864ebdf535c6 /activerecord/test/fixtures_test.rb | |
parent | ea713b6bb9680ef6226761dfc1501f261198723d (diff) | |
download | rails-f4b5ca1ff0113e41c974b7cbda1f734f9c0526fe.tar.gz rails-f4b5ca1ff0113e41c974b7cbda1f734f9c0526fe.tar.bz2 rails-f4b5ca1ff0113e41c974b7cbda1f734f9c0526fe.zip |
Fixed that create table with :id => false and fixtures don't play nice together (closes #10154) [jbarnette]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8205 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures_test.rb')
-rwxr-xr-x | activerecord/test/fixtures_test.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/test/fixtures_test.rb b/activerecord/test/fixtures_test.rb index 6f11a337b1..de0321fbf4 100755 --- a/activerecord/test/fixtures_test.rb +++ b/activerecord/test/fixtures_test.rb @@ -10,6 +10,7 @@ require 'fixtures/category' require 'fixtures/parrot' require 'fixtures/pirate' require 'fixtures/treasure' +require 'fixtures/matey' class FixturesTest < Test::Unit::TestCase self.use_instantiated_fixtures = true @@ -451,7 +452,7 @@ class FasterFixturesTest < Test::Unit::TestCase end class FoxyFixturesTest < Test::Unit::TestCase - fixtures :parrots, :parrots_pirates, :pirates, :treasures + fixtures :parrots, :parrots_pirates, :pirates, :treasures, :mateys def test_identifies_strings assert_equal(Fixtures.identify("foo"), Fixtures.identify("foo")) @@ -533,6 +534,12 @@ 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 end class ActiveSupportSubclassWithFixturesTest < ActiveSupport::TestCase |