authlogic flash[:notice] does not show up in cucumber webrat step

后端 未结 4 821
一个人的身影
一个人的身影 2021-01-26 02:30

I am running BDD steps with cucumber to implement my autlogic login behavior.

 Scenario: log in
Given a registered user: \"test@test.com\" with password: \"p@ssw         


        
相关标签:
4条回答
  • 2021-01-26 02:56

    I believe this issue will be fixed in Rails 2.3.9. It has to do with setting both a cookie and a session in the same request. See this ticket for details.

    In the meantime you can use this gist as a temporary fix.

    0 讨论(0)
  • 2021-01-26 03:02

    thanks to raynb who pointed me into the right direction. But unfurtunatly this solution did not work but I found this page which puts everything in cucumber.rb... which mad it running now ...

    https://webrat.lighthouseapp.com/projects/10503-webrat/tickets/383-reset_session-and-webrat-dont-play-nicely-with-one-another

    0 讨论(0)
  • 2021-01-26 03:07

    Looks like rails 2.3.8 has changed the method in which is displays notices..

    redirect_to(root_url, :notice => 'Login successful!')
    

    might be what you're looking for.

    0 讨论(0)
  • 2021-01-26 03:08

    instead of the line

    flash[:notice] = "Login successful!"   
    redirect_to root_url
    

    just try rendering it instead of redirecting it.

    flash[:notice] = "Login successful!"   
    render :action => :root_url
    

    in doing this, it seems to remember flash[:notice]

    i could not get --> redirect_to root_url, :flash => { :notice => 'not found' }, :notice => Login successful!' <-- to work at all

    0 讨论(0)
提交回复
热议问题