Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2021-12-08 16:27:44 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2022-01-14 14:57:39 +0300
commita5c896d1aa4f672ec46778b9f98c7850a38bc94c (patch)
tree177f574f9cc782f450983e4b073911448144089a /internal/acme
parenta7e130776d934a12ab000bee930c5c353b772635 (diff)
test: replace http status assertions with testify method
Diffstat (limited to 'internal/acme')
-rw-r--r--internal/acme/acme_test.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/acme/acme_test.go b/internal/acme/acme_test.go
index ab191694..0ee9e6fc 100644
--- a/internal/acme/acme_test.go
+++ b/internal/acme/acme_test.go
@@ -4,6 +4,8 @@ import (
"net/http"
"testing"
+ "github.com/stretchr/testify/require"
+
"gitlab.com/gitlab-org/gitlab-pages/internal/testhelpers"
)
@@ -40,11 +42,11 @@ var (
)
func TestServeAcmeChallengesNotConfigured(t *testing.T) {
- testhelpers.AssertHTTP404(t, serveAcmeOrNotFound(nil, domain), "GET", challengeURL, nil, nil)
+ require.HTTPStatusCode(t, serveAcmeOrNotFound(nil, domain), http.MethodGet, challengeURL, nil, http.StatusNotFound)
}
func TestServeAcmeChallengeWhenPresent(t *testing.T) {
- testhelpers.AssertHTTP404(t, serveAcmeOrNotFound(middleware, domainWithChallenge), "GET", challengeURL, nil, nil)
+ require.HTTPStatusCode(t, serveAcmeOrNotFound(middleware, domainWithChallenge), http.MethodGet, challengeURL, nil, http.StatusNotFound)
}
func TestServeAcmeChallengeWhenMissing(t *testing.T) {
@@ -54,5 +56,5 @@ func TestServeAcmeChallengeWhenMissing(t *testing.T) {
"https://gitlab.example.com/-/acme-challenge?domain=example.com&token=token",
)
- testhelpers.AssertHTTP404(t, serveAcmeOrNotFound(middleware, domain), "GET", indexURL, nil, nil)
+ require.HTTPStatusCode(t, serveAcmeOrNotFound(middleware, domain), http.MethodGet, indexURL, nil, http.StatusNotFound)
}