diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2020-06-09 09:20:31 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2020-07-06 02:13:51 +0300 |
commit | 2a23f2fb9bca74302dcdc40def50c748da4a5e06 (patch) | |
tree | 31698c64ca1b9b8dc370aa42d5015c63f5ca7fcb /internal/domain/domain_test.go | |
parent | 8e4dff76f1015bf10bdaedc295f726e80958bba1 (diff) |
Move serving 404 logic to domain package
Simplify responsibilities of auth package and reduce
complexity of app.go deciding which content to serve.
Diffstat (limited to 'internal/domain/domain_test.go')
-rw-r--r-- | internal/domain/domain_test.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/internal/domain/domain_test.go b/internal/domain/domain_test.go index e152b031..9e89f0e5 100644 --- a/internal/domain/domain_test.go +++ b/internal/domain/domain_test.go @@ -209,6 +209,16 @@ func TestDomain_ServeNamespaceNotFound(t *testing.T) { }, expectedResponse: "The page you're looking for could not be found.", }, + { + name: "no_parent_namespace_domain", + domain: "group.404.gitlab-example.com", + path: "/unknown", + resolver: &stubbedResolver{ + project: nil, + subpath: "/", + }, + expectedResponse: "The page you're looking for could not be found.", + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -218,7 +228,7 @@ func TestDomain_ServeNamespaceNotFound(t *testing.T) { } w := httptest.NewRecorder() r := httptest.NewRequest("GET", fmt.Sprintf("http://%s%s", tt.domain, tt.path), nil) - d.ServeNamespaceNotFound(w, r) + d.serveNamespaceNotFound(w, r) resp := w.Result() require.Equal(t, http.StatusNotFound, resp.StatusCode) |