You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
factory.associations returns an empty array. If we define the user association directly in the :published_profile factory, the step succeeds - but I'd rather inherit it from :profile.
I'd be happy to work on a patch, but I'm not sure what the expected behavior should be. Should factory.associations include inherited associations? Should the step definition be calling a different method?
The text was updated successfully, but these errors were encountered:
@eostrom IIRC factory#associations is only used by the step definitions, so it should be fine to change it there. I think it makes sense for the factory to calculate associations based on its inherited factories
This broke somewhere between
factory_girl
2.1.0 and 2.5.1.Given a simplified set of factories (for illustration; I haven't built an executable test case):
A step like this used to work:
Now it raises an exception:
User(#2193859180) expected, got String(#2151988680) (ActiveRecord::AssociationTypeMismatch)
I've tracked the problem as far as
lib/factory_girl/step_definitions.rb
:factory.associations
returns an empty array. If we define theuser
association directly in the:published_profile
factory, the step succeeds - but I'd rather inherit it from:profile
.I'd be happy to work on a patch, but I'm not sure what the expected behavior should be. Should
factory.associations
include inherited associations? Should the step definition be calling a different method?The text was updated successfully, but these errors were encountered: