diff options
author | Nick Thomas <nick@gitlab.com> | 2018-03-14 11:57:09 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-03-14 11:57:09 +0300 |
commit | 395684dd51c779bf2e0f28ddabfe2830dd3426f5 (patch) | |
tree | 9f0472b6d19c38713df2cb9df0ed02efd60f82e2 | |
parent | 7d9ea1897c38f02b0304516afb9dce8ad08b9ca4 (diff) |
Add acceptance tests for two very simple cases
-rw-r--r-- | acceptance_test.go | 22 | ||||
-rw-r--r-- | shared/pages/group/group.gitlab-example.com/public/index.html | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/acceptance_test.go b/acceptance_test.go index ff80a7a4..360b4c2e 100644 --- a/acceptance_test.go +++ b/acceptance_test.go @@ -61,6 +61,28 @@ func TestUnknownHostReturnsNotFound(t *testing.T) { } } +func TestUnknownProjectReturnsNotFound(t *testing.T) { + skipUnlessEnabled(t) + teardown := RunPagesProcess(t, *pagesBinary, listeners, "") + defer teardown() + + rsp, err := GetPageFromListener(t, httpListener, "group.gitlab-example.com", "/nonexistent/") + assert.NoError(t, err) + defer rsp.Body.Close() + assert.Equal(t, http.StatusNotFound, rsp.StatusCode) +} + +func TestGroupDomainReturns200(t *testing.T) { + skipUnlessEnabled(t) + teardown := RunPagesProcess(t, *pagesBinary, listeners, "") + defer teardown() + + rsp, err := GetPageFromListener(t, httpListener, "group.gitlab-example.com", "/") + assert.NoError(t, err) + defer rsp.Body.Close() + assert.Equal(t, http.StatusOK, rsp.StatusCode) +} + func TestKnownHostReturns200(t *testing.T) { skipUnlessEnabled(t) teardown := RunPagesProcess(t, *pagesBinary, listeners, "") diff --git a/shared/pages/group/group.gitlab-example.com/public/index.html b/shared/pages/group/group.gitlab-example.com/public/index.html new file mode 100644 index 00000000..d86bac9d --- /dev/null +++ b/shared/pages/group/group.gitlab-example.com/public/index.html @@ -0,0 +1 @@ +OK |