Forum: Ruby on Rails Configuring tests to run with no database

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.
79042d79edd8c830e4a15ea5e2cce628?d=identicon&s=25 david (Guest)
on 2005-11-14 14:07
(Received via mailing list)
Hi. I'm writing a very small rails app to display a form that submits to
a 3rd party web service. Because the 3rd party service handles data
storage, I don't need a database. I chose rails to take advantage of
everything it offers besides ActiveRecord, but it seems that I can't run
the tests without a database running, even though I'm not using a
database.

I've got unit tests running without the database by simply not using
rake to run them. The functional tests, however, come with very useful
services like TestRequest/TestRespsonse and all of the tag assertions,
so I'm using that framework. The fact that it needs to hook into the
database adds precious seconds to every single test run. Though that may
seem trivial, it's actually quite painful if you're using a TDD cycle
with very small steps (which I do).

Can anybody tell me how to configure the functional tests to run without
requiring a database?

Thanks,
David
24d2f8804e6bb4b7ea6bd11e0a586470?d=identicon&s=25 jeremy (Guest)
on 2005-11-14 19:40
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Nov 14, 2005, at 5:05 AM, David Chelimsky wrote:
> tag assertions, so I'm using that framework. The fact that it needs
> to hook into the database adds precious seconds to every single
> test run. Though that may seem trivial, it's actually quite painful
> if you're using a TDD cycle with very small steps (which I do).
>
> Can anybody tell me how to configure the functional tests to run
> without requiring a database?

Don't load Active Record in config/environment.rb and remove
   require 'activerecord/fixtures'
and the fixtures settings from test/test_helper.rb

That probably won't be enough, but it's a start.

jeremy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDeNm6AQHALep9HFYRAp3TAJ9hi6K8GD5GDRZ3rhMMKAmb01b+UgCg2lWj
40qfNQ8BIjljw0dWt5zWTVI=
=Gkow
-----END PGP SIGNATURE-----
This topic is locked and can not be replied to.