nextOneOff, err := database.CreateOneOffBuild() Expect(err).NotTo(HaveOccurred()) Expect(nextOneOff.ID).NotTo(BeZero()) Expect(nextOneOff.ID).NotTo(Equal(oneOff.ID)) Expect(nextOneOff.JobName).To(BeZero()) Expect(nextOneOff.Name).To(Equal("2")) Expect(nextOneOff.Status).To(Equal(db.StatusPending)) allBuilds, _, err := database.GetBuilds(db.Page{Limit: 100}) Expect(err).NotTo(HaveOccurred()) Expect(allBuilds).To(Equal([]db.Build{nextOneOff, jobBuild, oneOff})) }) It("also creates buildpreparation", func() { buildPrep, found, err := database.GetBuildPreparation(oneOff.ID) Expect(err).NotTo(HaveOccurred()) Expect(found).To(BeTrue()) Expect(buildPrep.BuildID).To(Equal(oneOff.ID)) }) }) Describe("build preparation update", func() { var ( oneOff db.Build err error ) BeforeEach(func() { oneOff, err = database.CreateOneOffBuild() Expect(err).NotTo(HaveOccurred())