You are trying to use Webrat with a new Rails 3.0.3 application but the redirection doesn’t work, and you get an error like:
You are being redirected. (RSpec::Expectations::ExpectationNotMetError)
According to a post here, there is a way to patch the webrat code so it follows the redirection.
After adding what is suggested above into your
#starting at line 288
- URI.parse(current_url).host || @custom_headers["Host"] ||
+ URI.parse(current_url).host || @custom_headers["Host"] ||
+ def default_current_host
+ adapter.class==Webrat::RackAdapter ? "example.org" :
and running your tests again, they should work.
Thanks yannnimac 🙂