我喜欢在工厂里传递论据,但它显示错误。我的代码是
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。
感谢您的回答。