Authlogic seems to be messing up my unit tests. When I try to run any unit test, I get:
authlogic/acts_as_authentic/base.rb:31:in `acts_as_authentic': You must establish a database connection before using acts_as_authentic (StandardError)
It doesn't matter what my unit test is. Even if all my unit test file contains is require 'test_helper'
, I still get the error. This, of course, tells me that the problem is probably in my test/test_helper.rb
file.
Here's my test/test_helper.rb
(based on the example here):
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'authlogic/test_case'
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integration tests
# -- they do not yet inherit this setting
fixtures :all
# Add more helper methods to be used by all tests here...
end
class ActionController::TestCase
setup :activate_authlogic
end
Is anybody else having this problem? I don't know what to do.