0

When I type this, everything works :

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

When I type this, my program get stuck with a deprecation warning :

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

I really need to launch my tests with rails_env=test Do you know what is going on?

Useful infos :

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

C:\dev>rails --version
Rails 3.2.12

My 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

Update :

I updated my rails version to 3.2.13. The warning disapeared but my app is still stuck.

Pol0nium
  • 1,346
  • 4
  • 15
  • 31
  • Although it doesn't address why you're seeing this warning in test and not in dev, it's fixed in 3.2.13 per http://stackoverflow.com/questions/14206775/rails-emits-warning-rackfile-headers-parameter-replaces-cache-control-after – Peter Alfvin Oct 01 '13 at 15:06
  • Is there some error in the log file (log/test.log)? What's the last statement in the log? Do you use the same database (pg) for both dev and test? Are both db properly set up (for test: `rake db:test:prepare`)? – koffeinfrei Oct 01 '13 at 20:27
  • try to setup environment with capital letters `set RAILS_ENV=test` – gotva Oct 02 '13 at 06:49

2 Answers2

1

Update to rails 3.2.13 -- this was a bug fixed

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

Scroll to the bottom for the closed marker to see the note.

trh
  • 7,186
  • 2
  • 29
  • 41
  • The warning is fixed but nothing happens anyway. The app is stuck. – Pol0nium Oct 01 '13 at 15:17
  • Interesting. I can't replicate this. Changes that I made to your gemfile are: I removed the ruby-oci8 and added the gem database_cleaner. – trh Oct 01 '13 at 15:36
  • I tried to remove ruby-oci8 and to add database_cleaner but nothing changed. Thanks for trying to help me. – Pol0nium Oct 01 '13 at 15:42
  • which database are you using for dev and for test? I noticed you have pg, oc, odbc, and sqlite gems -- which are you actually using for non-production? – trh Oct 01 '13 at 15:46
  • I use pgsql for my tests – Pol0nium Oct 01 '13 at 16:01
0

Fixed thanks to koffeinfre.

My test database config had a typo and I didn't know that I had logs into log/test.log.

Also, thanks to trh and Peter Alfvin for pointing out that the deprecation warning was fixed in rails 3.2.13.

Pol0nium
  • 1,346
  • 4
  • 15
  • 31