Beispiel #1
0
			Ω(pipelineDBFactory.BuildWithNameCallCount()).Should(Equal(1))
			pipelineName := pipelineDBFactory.BuildWithNameArgsForCall(0)
			Ω(pipelineName).Should(Equal("some-pipeline"))
		})

		Context("when getting the build succeeds", func() {
			BeforeEach(func() {
				pipelineDB.GetAllJobBuildsReturns([]db.Build{
					{
						ID:           3,
						Name:         "2",
						JobName:      "some-job",
						PipelineName: "some-pipeline",
						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"))
			})