Call trait from another trait with params in factory_girl
The :with_price
trait needs to be on a separate line from the other attributes you're setting, i.e. use this:
trait :with_usd_price do
with_price
short_name: 'USD'
end
instead of this:
trait :with_usd_price do
with_price short_name: 'USD'
end
I'm on factory_bot
4.8.2 and the following is what works for me:
trait :with_usd_price do
with_price
short_name 'USD'
end