Better regression test for Fixtures with fk as a symbol

上级 2a1b45af
......@@ -675,7 +675,7 @@ class FoxyFixturesTest < ActiveRecord::TestCase
if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
require 'models/uuid_parent'
require 'models/uuid_child'
fixtures :uuid_parents, :uuid_children
fixtures :uuid_parents, :uuid_children
end
def test_identifies_strings
......@@ -810,15 +810,6 @@ def test_namespaced_models
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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册