I am trying to make a simple functional test whith Authlogic.
I followed this how to:
http://rdoc.info/rdoc/binarylogic/authlogic/blob/f2e95179acf87f11b44c7a58e6083cf84cddff27/Authlogic/TestCase.html
but I have an error during “setup :activate_authlogic”
This is my users_controller_test.rb:
test “should get index” do
setup :activate_authlogic # <—error
user = operators(:ale)
UserSession.create(user)
get :index
assert_response :success
end
I have to login with authlogic (I am using it),
then I added require “authlogic/test_case” in test_helper.rb:
ENV[“RAILS_ENV”] = “test”
require File.expand_path(File.dirname(FILE) +
“/…/config/environment”)
require “authlogic/test_case” # <—
…
and then I added these lines in users_controller_test.rb :
setup :activate_authlogic # < — Error
user = operators(:ale)
UserSession.create(user)
When I run the test I get this error :
- Error:
test_should_get_index(AlarmsControllerTest):
ArgumentError: wrong number of arguments (1 for 0)
as if I have not inserted the require “authlogic/test_case” in
test_helper.rb
Someone can tell where is the bug ?
thank you,
Alessandro