Good morning, I am using Rails3 (beta4) and RSpec2 (beta 15) under RVM and am running into an interesting issue.
My request tests using webrat seem to think that they are running in the development Rails environment (I know this because I get all kinds of entries in the development log) and that is messing with Factory Girl (the factory_girl_rails gem). If I run "env" from the OSX command line, I have an entry for RAILS_ENV = development. After some poking around, I found the line: ENV["RAILS_ENV"] ||= 'test' in the spec_helper.rb file. I figured that this might be why webrat runs in the development environment since the above line won't do anything if RAILS_ENV is already set (which it is). If I remove the "||" from the above line, everything seems to work fine and webrat now stops putting stuff into the development log and puts stuff into the test log and the strangeness with factory_girl_rails goes away. I would like to confirm that removing the "||" from the spec_helper.rb file isn't going to mess with anything later down the road ro get an explanation as to why one wouldn't want to always force RAILS_ENV to be equal to "test" when running specs. Thanks, Mike -- Mike Gehard
_______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users