I’m writing a simple app that doesn’t need to use a database. I added
:active_record to the config.frameworks -= line in environment.rb
file. This lets me run ./script/generate fine without complaining
about no connection. However if I try to run a functional test, it
complains about no connection being established. Well…I don’t want
a connection to be established. I’ve tried overriding
Fixtures#teardown to be blank, but that doesn’t do anything. The
actual error is:
- Error:
test_get_convert(HhconvControllerTest):
ActiveRecord::ConnectionNotEstablished:
ActiveRecord::ConnectionNotEstablished
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:111:in
retrieve_connection' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in
connection’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:508:in
teardown_with_fixtures' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:531:in
teardown’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:529:in
`teardown’
I put this in my test_helper.rb file:
class Fixtures
def teardown() end
end
No luck though. I’d like to be able to run unit tests on my models
and functional tests on my controllers. I don’t see why it needs a
database to do that. Can anyone offer me any pointers?
Thanks,
Pat