Skip to content

Commit

Permalink
atc: behaviour: add flag to enable archive pipeline
Browse files Browse the repository at this point in the history
#5315 - as per
#5346 (comment),
the ability to archive pipelines is now behind an api flag
`enable-archive-pipeline`.

Signed-off-by: Aidan Oldershaw <aoldershaw@pivotal.io>
Co-authored-by: James Thomson <jthomson@pivotal.io>
  • Loading branch information
2 people authored and muntac committed Apr 30, 2020
1 parent 421cf38 commit 65edd02
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions atc/api/pipelineserver/archive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,25 @@ var _ = Describe("Archive Handler", func() {
Expect(body).To(Equal([]byte("endpoint is not enabled\n")))
})
})

Context("when the endpoint is not enabled", func() {
BeforeEach(func() {
server = pipelineserver.NewServer(
fakeLogger,
new(dbfakes.FakeTeamFactory),
new(dbfakes.FakePipelineFactory),
"",
false, /* enableArchivePipeline */
)
handler = server.ArchivePipeline(dbPipeline)
})

It("responds with status Forbidden", func() {
handler.ServeHTTP(recorder, request)

Expect(recorder.Code).To(Equal(http.StatusForbidden))
body, _ := ioutil.ReadAll(recorder.Body)
Expect(body).To(Equal([]byte("endpoint is not enabled\n")))
})
})
})

0 comments on commit 65edd02

Please sign in to comment.