我喜欢在 factorygirl 中传递参数,但它显示错误。我的代码是
When /^I create (\d+) companies and a company "([^"]*)" with "([^"]*)"$/ do |n,arg1,arg2|
create_companies n.to_i
click_on("Companies")
companies = FactoryGirl.create(:company, arg1: "#{arg2}", sub: 123)
companies.save_profile
end
我正在传递arg1
给Facorygirl
. 但其显示错误为
undefined method `arg1=' for #<Company:0x0000000c150ed0> (NoMethodError)
如何将 arg1 传递给 factorygirl。
感谢您的回答。