daze <dmonopoly10@...> writes:

> 
> 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!


Note the "confirm!" method call.



-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to