}) It("injects the PipelineDB", func() { Expect(pipelineDBFactory.BuildWithTeamNameAndNameCallCount()).To(Equal(1)) teamName, pipelineName := pipelineDBFactory.BuildWithTeamNameAndNameArgsForCall(0) Expect(pipelineName).To(Equal("some-pipeline")) Expect(teamName).To(Equal(atc.DefaultTeamName)) }) Context("when pausing the resource succeeds", func() { BeforeEach(func() { pipelineDB.PauseJobReturns(nil) }) It("paused the right job", func() { Expect(pipelineDB.PauseJobArgsForCall(0)).To(Equal("job-name")) }) It("returns 200", func() { Expect(response.StatusCode).To(Equal(http.StatusOK)) }) }) Context("when pausing the job fails", func() { BeforeEach(func() { pipelineDB.PauseJobReturns(errors.New("welp")) }) It("returns 500", func() { Expect(response.StatusCode).To(Equal(http.StatusInternalServerError)) })
authValidator.IsAuthenticatedReturns(true) }) It("injects the PipelineDB", func() { Ω(pipelineDBFactory.BuildWithNameCallCount()).Should(Equal(1)) pipelineName := pipelineDBFactory.BuildWithNameArgsForCall(0) Ω(pipelineName).Should(Equal("some-pipeline")) }) Context("when pausing the resource succeeds", func() { BeforeEach(func() { pipelineDB.PauseJobReturns(nil) }) It("paused the right job", func() { Ω(pipelineDB.PauseJobArgsForCall(0)).Should(Equal("job-name")) }) It("returns 200", func() { Ω(response.StatusCode).Should(Equal(http.StatusOK)) }) }) Context("when pausing the job fails", func() { BeforeEach(func() { pipelineDB.PauseJobReturns(errors.New("welp")) }) It("returns 500", func() { Ω(response.StatusCode).Should(Equal(http.StatusInternalServerError)) })