Forum: Ruby on Rails UserEngine testing

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5f79cc51f2e2e7b2bb982134e9c649e0?d=identicon&s=25 Jeroen van Doorn (Guest)
on 2006-02-15 12:59
(Received via mailing list)
Hi Everybody,

I'm playing around with the engines created by James Adam 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
05d703f649ef1d07e78d7b479fb4c4ac?d=identicon&s=25 James Adam (Guest)
on 2006-02-15 13:30
(Received via mailing list)
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

 james

On 2/15/06, Jeroen van Doorn <jeroen.vandoorn@solide-ict.nl> wrote:
>
>
--
* J *
  ~
5f79cc51f2e2e7b2bb982134e9c649e0?d=identicon&s=25 Jeroen van Doorn (Guest)
on 2006-02-15 13:51
(Received via mailing list)
Thanks for the push :) , 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?

Regards,
Jeroen
05d703f649ef1d07e78d7b479fb4c4ac?d=identicon&s=25 James Adam (Guest)
on 2006-02-15 14:18
(Received via mailing list)
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 :)

j

On 2/15/06, Jeroen van Doorn <jeroen.vandoorn@solide-ict.nl> wrote:
> Regards,
> >
> >> an easy way to do so.
> >> _______________________________________________
> > _______________________________________________
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
* J *
  ~
This topic is locked and can not be replied to.