1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Better regression test for Fixtures with fk as a symbol

This commit is contained in:
Arthur Neves 2014-09-22 13:12:19 -04:00
parent 2a1b45af56
commit c36ca0547f
No known key found for this signature in database
GPG key ID: 04A390FB1E433E17
2 changed files with 2 additions and 11 deletions

View file

@ -810,15 +810,6 @@ class FoxyFixturesTest < ActiveRecord::TestCase
assert admin_accounts(:signals37).users.include?(admin_users(:david))
assert_equal 2, admin_accounts(:signals37).users.size
end
class Nemesis < ActiveRecord::Base
self.table_name = "mateys"
belongs_to :mortal_enemy, :class_name => 'Pirate', :foreign_key => :target_id
end
def test_symbol_foreign_key_id
ActiveRecord::FixtureSet.create_fixtures(FIXTURES_ROOT, "nemeses", "nemeses" => Nemesis)
end
end
class ActiveSupportSubclassWithFixturesTest < ActiveRecord::TestCase

View file

@ -19,7 +19,7 @@ class LiveParrot < Parrot
end
class DeadParrot < Parrot
belongs_to :killer, :class_name => 'Pirate'
belongs_to :killer, :class_name => 'Pirate', foreign_key: :killer_id
end
class FunkyParrot < Parrot