开发者

Cucumber and persistant sessions across redirects

Im using

rails - 2.3.8
cucumber - 0.8.5
cucumber-rails - 0.3.2
capybara - 0.4.0

I am trying to test a particular login/registration scenario where the user is redirected before landing on the required page. On redirect, cucumber flushes the session ie the user is no longer logged in.

Any ideas on how to prevent this?

EDIT

The feature im trying to test is as follows:

Feature: Check Register and SignUp  
    In order to use products
    As a User
    I want to register and login

    @javascript
    Scenario: Register on Landing Page
            When I go to Landing Page
            And I fill in "user_email" with "test@test.com"
            And I fill in "user_email_confirmation" with "test@test.com"
            And I fill in "user_password" with "testpass"
            And I select "State" from "state"
            And I press "Register Free"
            And I wait until Ajax requests are complete
            Then I should be on Home

When i add And show me the page to the feature, i see the Landing Page again.

Edit 2

I'm using restful_authentication for authentication. The actual working is, when the form submits, the user is taken to a page and then redirected to the home page. This works when testing manually, but not when using cucumber.

Edit 3 Code开发者_运维问答 formatting


perhaps a silly detail, though have you double checked that the url of the paths you've set match the site host in your cuke config? This bit us for a while while testing some cross-site JSON-P stuff...

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜