On Nov 20, 2007, at 8:07 PM, Pat Maddox wrote: > On Nov 20, 2007 2:55 PM, Jonathan Linowes <[EMAIL PROTECTED]> > wrote: >> fyi, I just posted this >> >> http://www.vaporbase.com/postings/Running_rspec_after_you_deploy >> >> - linoj >> _______________________________________________ >> rspec-users mailing list >> rspec-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > > I'm kind of confused. You say that you're not running the specs > against the production database, but it looks like that's exactly > what's going on. What am I missing? > > Pat > _______________________________________________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
It confused me too. I assume you're referring to the rake spec command. I've not followed the code, but what it does is connect to the development database first (or production one if you say RAILS_ENV=production) before getting to spec_helper which in turn specifies ENV["RAILS_ENV"] = "test" to connect to the test one before running the specs. In my case the development: section in database.yml defines the one on my development machine, so the spec fails when run on the server with an error cannot connect to the database unless I say RAILS_ENV=production Not this only occurs on rake spec, not when running script/spec see thread http://rubyforge.org/pipermail/rspec-users/2007-October/ 004206.html --linoj _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users