In a Cucumber step definition, I'm trying to login, but I keep getting
this error:
You must activate the Authlogic::Session::Base.controller with a
controller object before creating objects
(Authlogic::Session::Activation::NotActivatedError)
My code:
Given /^I am the logged in (.+) "(.+)"$/ do |role, login|
user = User.create!(
:login => login,
:password => "some_password",
:password_confirmation => "some_password",
:role => role,
:email => "some_email@somewhere.com"
)
#Authlogic::Session::Base.controller =
Authlogic::ControllerAdapters::RailsAdapter.new(self)
UserSession.create(
:login => login,
:password => "some_password"
)
end
I found that commented out bit - Authlogic::Session::Base.controller =
Authlogic::ControllerAdapters::RailsAdapter.new(self) - online, but it
leads to "save" not working.
In a Cucumber step definition, I'm trying to login, but I keep getting
this error:
You must activate the Authlogic::Session::Base.controller with a
controller object before creating objects
(Authlogic::Session::Activation::NotActivatedError)
Are you using confirmable? It looks like the user is not confirmed. Luckily,
devise has a trick for that:
My code:
Given /^I am the logged in (.+) "(.+)"$/ do |role, login|
user = User.create!(
:login => login,
:password => "some_password",
:password_confirmation => "some_password",
:role => role,
:email => "some_email@..."
)
Try
Given /^I am the logged in (.+) "(.+)"$/ do |role, login|
user = User.create!(
:login => login,
:password => "some_password",
:password_confirmation => "some_password",
:role => role,
:email => "some_email@..."
).confirm!