Webrat 0.7.2 problem with Rails 3.0.3

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 webrat/lib/core/session.rb, ie:

#starting at line 288
def current_host
- 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" :
+ end

and running your tests again, they should work.

Thanks yannnimac 🙂