WebRat page not loaded (you are being redirected)

118 views Asked by At

I have setup Webrat according to https://github.com/brynary/webrat

But when I want to:

"vist 'new'

then the "fill_in" method doesn't work.

This is because response.body has the contents:

"<html><body>You are being <a href=\"https://test.host/login\">redirected</a>.</body></html>"

Can anyone tell why?

1

There are 1 answers

0
Peter Goldstein On

The 'new' page requires authentication, so you're being redirected to the login page. So you should either:

  1. Remove authentication from the 'new' page
  2. Use a sign_in helper to sign in the user before the body of the spec