I am trying to write a short-form login/logout step that works with
Authlogic (2.1.6) and I cannot seem to discover how to get this to
work. Has anyone here managed to do this successfully?
I have tried this:
Before do
activate_authlogic
end
When /user named "(.*)" logs in/ do |login|
user = User.find_by_username( login.downcase )
@local_user_session = UserSession.create!( user )
puts( @local_user_session )
end
gives this:
#<UserSession: {:unauthorized_record=>"<protected>"}>
But this user session object does not seem to match what I get from
user_session_controller#create
#<UserSession:
{:password=>"<protected>", :username=>#<ActiveSupport::Multibyte::Chars:
0x2ac27e7afec0 @wrapped_string="myuser">}>
Destroying the UserSession gives the same result as the create
#<UserSession: {:unauthorized_record=>"<protected>"}>
I then changed to the alternate syntax and used the create! method.
This indicates the root of the problem:
user = User.find_by_username!( name.hll_normalise )
puts( user.username )
@current_user_session = UserSession.create!(
:login => user.username,
:password => user.username + "-password",
:remember_me => true )
gives:
tester
Your session is invalid and has the following errors: Username
cannot be blank (Authlogic::Session::Existence::SessionInvalidError)
./features/app/models/users/step_definitions/
user_authentication_steps.rb:175:in `/user named "(.*)" is
authenticated/'
features/app/models/users/user_authentication.feature:59:in `And
the user named "tester" is authenticated'
Is AuthLogic still actively supported? I do not see any activity on
the GitHub repository since the beginning of September and the issues
list seems to be getting little attention as well. If it has been
abandoned then which fork are people moving to?