From 5dd7a6a5ad855f907d41e0eb9515c9b894372fd6 Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Fri, 8 Jul 2022 11:55:15 +0800 Subject: [PATCH] Add integration test for the branch name replacing rule --- integration/get_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/integration/get_test.go b/integration/get_test.go index 9cb66f5..1997010 100644 --- a/integration/get_test.go +++ b/integration/get_test.go @@ -49,6 +49,16 @@ func TestGetContent(t *testing.T) { assert.EqualValues(t, "text/html; charset=utf-8", resp.Header.Get("Content-Type")) assert.True(t, getSize(resp.Body) > 1000) assert.Len(t, resp.Header.Get("ETag"), 42) + + // access branch name contains '/' + resp, err = getTestHTTPSClient().Get("https://blumia.localhost.mock.directory:4430/pages-server-integration-tests/@docs~main/") + assert.NoError(t, err) + if !assert.EqualValues(t, http.StatusOK, resp.StatusCode) { + t.FailNow() + } + assert.EqualValues(t, "text/html; charset=utf-8", resp.Header.Get("Content-Type")) + assert.True(t, getSize(resp.Body) > 100) + assert.Len(t, resp.Header.Get("ETag"), 42) } func TestCustomDomain(t *testing.T) {