Beispiel #1
0
						Status:       db.StatusStarted,
					},
					{
						ID:           1,
						Name:         "1",
						JobName:      "some-job",
						PipelineName: "some-pipeline",
						Status:       db.StatusSucceeded,
					},
				}, nil)
			})

			It("fetches by job and build name", func() {
				Ω(pipelineDB.GetAllJobBuildsCallCount()).Should(Equal(1))

				jobName := pipelineDB.GetAllJobBuildsArgsForCall(0)
				Ω(jobName).Should(Equal("some-job"))
			})

			It("returns 200 OK", func() {
				Ω(response.StatusCode).Should(Equal(http.StatusOK))
			})

			It("returns the builds", func() {
				body, err := ioutil.ReadAll(response.Body)
				Ω(err).ShouldNot(HaveOccurred())

				Ω(body).Should(MatchJSON(`[
					{
						"id": 3,
						"name": "2",