开发者

Session gone in Integration Tests in Rails 2.3.10

In Rails 2.3.8 my integration tests (after considerable work, and the help of this post) were able to make use of a single session across requests. In Rails 2.3.10, that functionality broke, and after logging in开发者_开发百科, subsequent requests have no session.

One possible symptom is that this bit of code used to pass:

open_session do |s|
 s.post 'login', :user=>{:user_name=>username, :password=>pass}
 assert_not_nil(s.session[:id])
end

And now it fails (s.session[:id] is nil). This may or may not be the problem, as I can confirm that other variables stored in the session during the login action are present. However on subsequent s.post's, the actions all report that there's nothing in the session.

Any advice? I saw one report that Rails 2.3.9 introduced a session bug with this as the workaround, but it doesn't appear to make a difference.

Thanks, Tom


Did you try s.session.data[:id]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜