I'm trying to test a post request with capybara and cucumber. I can't visit a page and press a link to send the request because it has a confirm dialogue and I haven't made it work with javascript so I'm trying to use the post method and then test if it redirects to the appropriated url but I'm getting:
No response yet. Request a page first. (Rack::Test::Error)
My code is:
page.driver.post url
page.driver.status_code.should be 302
follow_redirect!
It's working fine until follow_redirect!
. I've tried page.driver.follow_redirects!
but it doesn't work either.
Any help?