mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Integration test url options should account for :protocol not just https?
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user