Exemple #1
0
								Ω(err).Should(HaveOccurred())
								Ω(templateData).Should(Equal(TemplateData{}))
							})
						})

						Context("when we get inputs and outputs", func() {
							BeforeEach(func() {
								fakeDB.GetBuildResourcesReturns(inputs, outputs, nil)
							})

							It("populates the inputs and outputs for the builds returned", func() {
								templateData, err := FetchTemplateData(fakeDB, "job-name")
								Ω(err).ShouldNot(HaveOccurred())
								Ω(fakeDB.GetBuildResourcesCallCount()).Should(Equal(1))

								calledBuildID := fakeDB.GetBuildResourcesArgsForCall(0)
								Ω(calledBuildID).Should(Equal(1))

								Ω(templateData.Builds).Should(Equal(buildsWithResources))
							})
						})
					})

					Context("when the get job lookup returns a job", func() {
						var groupStates []group.State
						var dbJob db.SavedJob

						BeforeEach(func() {
							groupStates = []group.State{
								{
									Name:    "group-with-job",