From c1ebd9c651fc842507b032efba7128b567f55b3e Mon Sep 17 00:00:00 2001 From: Fabian Vowie Date: Sun, 6 Feb 2022 15:45:48 +0100 Subject: [PATCH] Show slug instead of name for pipelines in index metadata --- main.go | 2 +- main_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index d7748d4..254a4c4 100644 --- a/main.go +++ b/main.go @@ -40,7 +40,7 @@ func PipelineHandler(pipeline pipelines.IPipeline, storageProvider storage.IStor func IndexHandler(pipelines []pipelines.IPipeline, w http.ResponseWriter, r *http.Request) { var pipelineNames []string for _, x := range pipelines { - pipelineNames = append(pipelineNames, x.GetName()) + pipelineNames = append(pipelineNames, x.GetSlug()) } w.Header().Set("Content-Type", "application/json") diff --git a/main_test.go b/main_test.go index 3286a51..1fb910a 100644 --- a/main_test.go +++ b/main_test.go @@ -44,7 +44,7 @@ func TestIndexRoute(t *testing.T) { err = json.Unmarshal(responseRecorder.Body.Bytes(), &body) assert.Nil(t, err) assert.Equal(t, 1, len(body.Pipelines)) - assert.Equal(t, data.Name, body.Pipelines[0]) + assert.Equal(t, data.Slug, body.Pipelines[0]) }) }