Skip to content

Commit fe52278

Browse files
Copilotjoelhawksley
andcommitted
Add HTTPS URL generation test to rendering_test.rb
Co-authored-by: joelhawksley <1940294+joelhawksley@users.noreply.github.com>
1 parent 804c2bb commit fe52278

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

test/sandbox/test/rendering_test.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,23 @@ def test_with_request_url_with_host
964964
end
965965
end
966966

967+
def test_with_request_url_with_https_protocol
968+
with_request_url "/", protocol: "https" do
969+
render_inline UrlForComponent.new(only_path: false)
970+
assert_text "https://www.example.com/?key=value"
971+
end
972+
973+
with_request_url "/products", protocol: "https", host: "secure.example.com" do
974+
render_inline UrlForComponent.new(only_path: false)
975+
assert_text "https://secure.example.com/products?key=value"
976+
end
977+
978+
with_request_url "/products", protocol: "https" do
979+
assert_equal "https", vc_test_request.scheme
980+
assert vc_test_request.ssl?
981+
end
982+
end
983+
967984
def test_components_share_helpers_state
968985
PartialHelper::State.reset
969986

0 commit comments

Comments
 (0)