Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Integration test url options should account for :protocol not just ht…

…tps?
  • Loading branch information...
commit 2a50eabf4576580dff9b43c3d830cd78e8fbb353 1 parent dcf1441
@jeremy jeremy authored
View
10 actionpack/lib/action_dispatch/testing/integration.rb
@@ -177,14 +177,8 @@ def initialize(app)
reset!
end
- def url_options
- opts = super.reverse_merge(
- :host => host,
- :protocol => https? ? "https" : "http"
- )
-
- opts.merge!(:port => 443) if !opts.key?(:port) && https?
- opts
+ def default_url_options
+ { :host => host, :protocol => https? ? "https" : "http" }
end
# Resets the instance. This can be used to reset the state information
View
7 actionpack/test/dispatch/url_generation_test.rb
@@ -34,5 +34,10 @@ def app
get "/foo", {}, 'SCRIPT_NAME' => "/new"
assert_equal "/new/foo", response.body
end
+
+ test "handling http protocol with https set" do
+ https!
+ assert_equal "http://www.example.com/bar/foo", foo_url(:protocol => "http")
+ end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.