Skip to content

Conversation

@hybridindie
Copy link

Now that Rails 3 is an actual Rack application the testing urls are not working with controller redirects (redirect_to some_path). These return a page with only "You are being redirected." as the content currently and on webrat/master. This corrects that issue and allows for the redirects to happen as would be expected.

@raid5
Copy link

raid5 commented Jan 10, 2011

Can't wait for this patch to be accepted. A lot of people seem to be having issues related to this at the moment.

@orbiteleven
Copy link

+1 I've been banging my head against this for the past 4 hours. Glad to see it's not just me.

@jphpsf
Copy link

jphpsf commented Feb 14, 2011

+1

For now, I've been placing the a webrat_host_fix.rb file under features/support/ (I am using cucumber)

# Fix the issue between webrat 0.7.3 using "example.org" and rails 3.x using "example.com"
Webrat::Session.class_eval do
    def current_host
        URI.parse(current_url).host || @custom_headers["Host"] || default_current_host
    end

    def default_current_host
        adapter.class == Webrat::RackAdapter ? "example.org" : "www.example.com"
    end
end

@henningjensen-tu
Copy link

+1

Difficult to perform any valuable testing with cucumber and webrat without this fix.

@bmfreitas
Copy link

+1

Can't wait to remove the hack that override the DEFAULT_HOST constant to avoid the "already initialized constant DEFAULT_HOST" warning.

@dlibanori
Copy link
Contributor

Nice work, but I think it is tightly coupled with Rack::Test internals. I did another patch, improving Webrat specs and less coupled with Rack::Test.

#52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants