Beispiel #1
0
						Paused:       false,
						PipelineName: "pipeline",
						Resource: db.Resource{
							Name: "resource-name",
						},
					}

					fakeDB.GetResourceReturns(resource, nil)
				})

				Context("when we are logged in", func() {
					authenticated := true

					Context("when looking up the max id fails", func() {
						BeforeEach(func() {
							fakeDB.GetResourceHistoryMaxIDReturns(0, errors.New("disaster"))
						})

						It("returns an error", func() {
							_, err := FetchTemplateData(fakeDB, false, "resource-name", 0, false)
							Expect(err).To(HaveOccurred())
						})
					})

					Context("when looking up the max id succeeds", func() {
						Context("when there are more than 100 results", func() {
							const MaxID int = 150

							BeforeEach(func() {
								fakeDB.GetResourceHistoryMaxIDReturns(MaxID, nil)