Ruby on rails 没有这样的工厂:用户(ArgumentError),但。。。它是被定义的。使用find_definitions()只会查找重复项=\
所以,我最近搬到了bundler,我很难让一切都恢复正常 当我运行bundle exec rake test:units时,出现以下错误:Ruby on rails 没有这样的工厂:用户(ArgumentError),但。。。它是被定义的。使用find_definitions()只会查找重复项=\,ruby-on-rails,bundler,factory-bot,Ruby On Rails,Bundler,Factory Bot,所以,我最近搬到了bundler,我很难让一切都恢复正常 当我运行bundle exec rake test:units时,出现以下错误: ....../gems/factory_girl-1.2.4/lib/factory_girl/factory.rb:327:in `factory_by_name': No such factory: user (ArgumentError) 我在另一篇堆栈溢出帖子中看到,有人通过添加 FactoryGirl.find_definitions 但是,说
....../gems/factory_girl-1.2.4/lib/factory_girl/factory.rb:327:in `factory_by_name': No such factory: user (ArgumentError)
我在另一篇堆栈溢出帖子中看到,有人通过添加
FactoryGirl.find_definitions
但是,说我有重复定义的错误(我没有,这会导致搜索)
我甚至试着只用一个工厂文件。但错误还在继续
测试辅助程序的顶部:
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
require "bundler/setup"
Bundler.require(:test)
gem文件中的测试组
group :test do
gem "cucumber", "~>0.10.3"
gem "cucumber-rails", "0.3.2"
gem "launchy"
gem "hpricot"
gem "gherkin", "~>2.4.0"
gem "capybara", "0.4.1.2"
gem "rspec", "1.3.2"
gem "rspec-rails", "1.3.2"
gem "rspec-core"
gem "rspec-expectations"
gem "webrat", "0.7.0"
gem "database_cleaner"
gem "factory_girl", "1.2.4"
gem "shoulda"
gem "awesome_print"
gem "cobravsmongoose"
end