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

折月煮酒 提交于 2019-12-02 10:22:49

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

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.

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!