UserEngine testing


Hi Everybody,

I’m playing around with the engines created by James A. and I bumped
into the following.
I would like the rake bootstrap command to use the testing database and
I just know there’s
an easy way to do so.

I could have just copied the dev db’s to the test db’s but I think I’m
missing something fundamental here.

Hints are very welcome.

Kind regards,
Jeroen van Doorn


if you set an environment variable RAILS_ENV to ‘test’, it should use
your test environment (and database…). I think with rake you do
this by passing it in on the command line, i.e.

rake bootstrap RAILS_ENV=test


On 2/15/06, Jeroen van Doorn removed_email_address@domain.invalid wrote:

  • J *


I don’t think there is a ‘proper’ way, since both are valid. If you
want to be sure that your Rails app is going to run in a particular
environment, regardless of the surrounding server setup, change
environment.rb. If it’s just that you want to run a few commands on
production now and again, it’s less hassle to just specify it on the
command line :slight_smile:


On 2/15/06, Jeroen van Doorn removed_email_address@domain.invalid wrote:


an easy way to do so.


  • J *


Thanks for the push :slight_smile: , another question in the same direction …

Found the following three lines in environment.rb

Uncomment below to force Rails into production mode when

you don’t control web/app server and can’t set it the proper way

ENV[‘RAILS_ENV’] ||= ‘production’

but what’s comes to mind is what is the proper way?