aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_dispatch/testing/integration.rb10
-rw-r--r--actionpack/test/dispatch/url_generation_test.rb7
2 files changed, 8 insertions, 9 deletions
diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb
index 0aff4250c1..31067e56b4 100644
--- a/actionpack/lib/action_dispatch/testing/integration.rb
+++ b/actionpack/lib/action_dispatch/testing/integration.rb
@@ -177,14 +177,8 @@ module ActionDispatch
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
diff --git a/actionpack/test/dispatch/url_generation_test.rb b/actionpack/test/dispatch/url_generation_test.rb
index 18b5b7ee00..b863e37a33 100644
--- a/actionpack/test/dispatch/url_generation_test.rb
+++ b/actionpack/test/dispatch/url_generation_test.rb
@@ -34,5 +34,10 @@ module TestUrlGeneration
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 \ No newline at end of file
+end