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

@ -675,7 +675,7 @@ class FoxyFixturesTest < ActiveRecord::TestCase
if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL' if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
require 'models/uuid_parent' require 'models/uuid_parent'
require 'models/uuid_child' require 'models/uuid_child'
fixtures :uuid_parents, :uuid_children fixtures :uuid_parents, :uuid_children
end end
def test_identifies_strings def test_identifies_strings
@ -810,15 +810,6 @@ class FoxyFixturesTest < ActiveRecord::TestCase
assert admin_accounts(:signals37).users.include?(admin_users(:david)) assert admin_accounts(:signals37).users.include?(admin_users(:david))
assert_equal 2, admin_accounts(:signals37).users.size assert_equal 2, admin_accounts(:signals37).users.size
end 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 end
class ActiveSupportSubclassWithFixturesTest < ActiveRecord::TestCase class ActiveSupportSubclassWithFixturesTest < ActiveRecord::TestCase

View file

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