I'm very new to rails and recently I'm trying to use Resque and Rspec to test my codes. What I'm stocked with is to change Resque environment to test.
This is my state:
$ resque-web [2014-09-19 21:52:43 +0430] Starting 'resque-web'... [2014-09-19 21:52:43 +0430] trying port 5678... Couldn't get a file descriptor referring to the console</li>
http://0.0.0.0:5678/stats/resque
Well, on Stats
tab, there's a table and at the first row, environment is set to development.
I want to set Resque environment to test, so that I test jobs created by my rspec tests using test database, but I don't know how.Any tips?
Try to set the RAILS_ENV
environment variable before running resque-web
, e.g.
$ RAILS_ENV=test resque-web