开发者

Using Cucumber with Authlogic

I recently upgraded cucumber to version 0.8.5, but I'm getting some unexpected errors with Authlogic. As a precursor to many of my user interface tests I have a default 'Given I am logged in' method that logs a user in through the standard login interface and asserts that they were redirected to the home page. Prior to upgrading cucumber I had no issue with this method, but when I run my tests now I get a NoMethodError on my the current_user helper provided by Authlogic. The user seems to log in fine (as there is no issue asserting that they are on the homepage after login), but as soon as 'current_user' method is called on t开发者_运维知识库he homepage it returns a false symbol. The current_user helper is simple enough. All it does is validate that the current session matches up with a user, and if it doesn't then it returns false.

def current_user
@current_user ||= (session[:user] && User.find(session[:user])) || :false
end

This makes me think that Cucumber 0.8.5 is logging me in, but not storing my session data. Am I missing something? I've heard that recent versions of Cucumber have had issues with storing session data, but I can't figure this one out. Anyone else had a similar problem?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜