api: add 401 test for archiving
Specifically for the pipelines/:pipeline_name/archive endpoint
@@ -976,6 +976,16 @@ var _ = Describe("Pipelines API", func() {
Expect(response.StatusCode).To(Equal(http.StatusInternalServerError))
})
})
+
+ Context("when not authenticated", func() {
+ BeforeEach(func() {
+ fakeAccess.IsAuthenticatedReturns(false)
+ })
+
+ It("returns 401", func() {
+ Expect(response.StatusCode).To(Equal(http.StatusUnauthorized))
+ })
+ })
})
Describe("PUT /api/v1/teams/:team_name/pipelines/:pipeline_name/unpause", func() {
