论证不能传递给工厂女郎

时间:2013-07-11 12:35:28

标签: ruby-on-rails rspec cucumber capybara factory-bot

我喜欢在工厂里传递论据,但它显示错误。我的代码是

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。

感谢您的回答。

0 个答案:

没有答案