2
namespace :fixtures do
namespace :load do
task :prepare => :environment do
ENV['FIXTURES_PATH'] = "spec/fixtures"
ENV['RAILS_ENV'] ||= "test"
puts ENV.inspect
Rake::Task["db:fixtures:load"].invoke
end
end
end
我已经将此项添加到./lib/tasks中的special.rake文件中,以便使rake db:fixtures:load命令应用于规范中的fixture/fixtures目录,并应用于测试环境。更改耙测任务以在测试环境中工作
这不起作用。有没有人看到我出错的地方?谢谢!
我觉得这个回答可以帮助你, 的http://计算器。 com/a/1090319/1475028 – Narmadha
该链接非常有用,谢谢! – pitosalas