Reputation: 12209
There is the following code:
factory :item do
name 'Some name'
description 'Some description'
cost 100
cooking_time 10
menu
end
This code sets up cooking_time as a constant value, but how can I pass param for this param with default value (10)? Thanks
Upvotes: 0
Views: 135
Reputation: 2385
create(:item, cooking_time: 20)
For more inforamation please go through Factory Girl Documentation
Upvotes: 1
Reputation: 5249
You just override the attribute when you use the factory in your test:
create(:item, cooking_time: 20)
Upvotes: 0