How to redirect, set session using webrat cucumber
Am using windows xp, ruby (1.8.7), rails(2.3.5), cucumber(1.10.2), werat(0.7.3). Am entirely new to cucumber webrat and selenium.
Can someone direct me how to do these things.
1)How to redirect with click_button
Example S开发者_运维知识库cenario:
Given I am a existing user
When i visit login page
Then enter login credentials
Then i should see "User logged in successfully"
Am getting same login page when i run this scenario
2)When i give save_and_open_page, instead of browser window am getting a command prompt
3) How to set a user session with webrat
4) Why webrat is using "www.example.com" as default how to set host name?
Am facing lots of problem due to lack of knowledge in webrat and cucumber. Can any one guide me how to start with?
1) click_button should follow any redirects that your app sends
2) check you have the Launchy gem installed
3) webrat will accept and send cookies set by your app
4) If you're using Capybara set the Capybara.app_host (I'm not sure how to do it directly with Webrat)
I suggest you check out the episodes 155,156 and 159 on railscasts.
精彩评论