Unit testing a polymorphic association with fixtures in rails 4
|Added at||2016-12-24 04:12|
I need to unit test a promotions model where every campaign has a URL. There is a polymorphic association between promotions and reference_link. the reference link fixture
How do I convince rails that the promotions fixture does indeed have a URL belonging to it?
In promotions test helper
class PromoCode < ActiveRecord::Base
class ReferenceLink < ActiveRecord::Base belongs_to :linkable, polymorphic: true,touch: true