当rails_env = test时,Rspec不工作

时间:2013-10-01 14:51:07

标签: ruby-on-rails ruby rspec

当我输入时,一切正常:

set rails_env=development
rspec spec/models/foo.rb

当我输入时,我的程序会遇到弃用警告:

set rails_env=test
rspec spec/models/foo.rb
->Rack::File headers parameter replaces cache_control after Rack 1.5.

我真的需要用rails_env=test启动我的测试你知道发生了什么吗?

有用的信息:

C:\dev>ruby --version
ruby 1.9.3p385 (2013-02-06) [i386-mingw32]

C:\dev>rails --version
Rails 3.2.12

我的Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.12'    
gem 'sqlite3'
gem 'delayed_job_active_record', '= 0.3.3'
gem 'delayed_job', '= 3.0.5'
gem 'clockwork'
gem 'dj_mon'
gem 'libxml-ruby'
gem 'haml-rails'
gem 'log4r'
gem 'spreadsheet'
gem 'mail'
gem "axlsx", "= 2.0.0"
gem 'axlsx_rails'
gem 'ruby-prof'
gem 'test-unit', :require => "test/unit"
gem 'ruby-oci8', '= 2.1.4'
gem 'pg', :require => 'pg'
gem 'devise', '<= 2.2.3'
gem 'cancan', '<= 1.6.9'
gem 'validates_timeliness'
gem 'will_paginate'
gem 'nokogiri'
gem 'simplecov'
gem 'google_visualr'
gem 'thin'
gem 'workflow'
gem 'ruby-graphviz'
gem 'ruby-odbc'
gem 'rubyzip',  "= 0.9.9"
gem "rspec-deep-ignore-order-matcher"
gem 'rspec'
gem 'awesome_print'
gem 'syntax'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'   
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails', '2.3.0'

group :test, :development do
  gem "rspec-rails", "~> 2.0"
end

更新:

我将我的rails版本更新为3.2.13。警告消失了,但我的应用仍然停滞不前。

2 个答案:

答案 0 :(得分:1)

更新到rails 3.2.13 - 这是一个修复过的错误

https://github.com/rails/rails/pull/8812

滚动到底部以查看关闭的标记以查看注释。

答案 1 :(得分:0)

感谢koffeinfre

我的测试数据库配置有错误,我不知道我已登录log/test.log

另外,感谢trhPeter Alfvin指出弃用警告已在rails 3.2.13中修复。