diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-11-27 16:02:21 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-11-27 16:07:06 +0300 |
commit | 84812ac14c428b7af6d6a185bc1894b7ea47dc45 (patch) | |
tree | 580513fe09683674861e866347a794004f0169bc /acceptance_test.go | |
parent | f7d89e372df5d4c59c1a175bb807578f4350391b (diff) |
Add acceptance tests for new domains source
Diffstat (limited to 'acceptance_test.go')
-rw-r--r-- | acceptance_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/acceptance_test.go b/acceptance_test.go index fe598b0c..3ed69254 100644 --- a/acceptance_test.go +++ b/acceptance_test.go @@ -16,6 +16,7 @@ import ( "time" "github.com/namsral/flag" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -1531,3 +1532,26 @@ func TestApiSecretKeyFlagIsSupported(t *testing.T) { teardown := RunPagesProcess(t, *pagesBinary, listeners, "", "-api-secret-key", "/path/to/secret.key") defer teardown() } + +func TestGitlabDomainsSource(t *testing.T) { + skipUnlessEnabled(t) + + source := NewGitlabDomainsSourceStub(t) + defer source.Close() + + sourceArgs := []string{ + "-gitlab-server", source.URL, + // "-api-secret-key", "/path/to/secret.key", + } + teardown := RunPagesProcess(t, *pagesBinary, listeners, "", sourceArgs...) + defer teardown() + + response, err := GetPageFromListener(t, httpListener, "new-source.test.io", "/my/pages/project/") + require.NoError(t, err) + + defer response.Body.Close() + body, _ := ioutil.ReadAll(response.Body) + + assert.Equal(t, http.StatusOK, response.StatusCode) + assert.Equal(t, "New Pages GitLab Source PoC OK\n", string(body)) +} |