提交 2a50eabf 编写于 作者: J Jeremy Kemper

Integration test url options should account for :protocol not just https?

上级 dcf1441c
......@@ -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
......
......@@ -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
\ No newline at end of file
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册