I have created a custom Rails integration environment that i use to run Selenium tests. The tests run fine in this new environment, however the problem is that within the test code, the RAILS_ENV
variable is set to test
.
I have a test helper class which is similar to the default rails test_helper class, and defines ENV["RAILS_ENV"] = "integration"
. This test helper also contains some code to manipulate data in the db. For example, to activate a new user. These records are put in the correct db, but the environment variable is still incorrect.
From the command line I am running the tests like so: RAILS_ENV=integration ruby test/selenium/account_test.rb
but did not help.
The root problem here is that, I have code deeper in my application that reads custom configuration information which is based on the current environment. In the scenario described above, this is failing.
So how can i set the RAILS_ENV
to a value other than test
when running