Context("when the engine build exists", func() { var realBuild *fakes.FakeBuild BeforeEach(func() { fakeBuildDB.GetBuildReturns(model, true, nil) realBuild = new(fakes.FakeBuild) fakeEngineB.LookupBuildReturns(realBuild, nil) }) Context("when getting the plan via the engine succeeds", func() { BeforeEach(func() { var plan json.RawMessage = []byte("lol") realBuild.PublicPlanReturns(atc.PublicBuildPlan{ Schema: "some-schema", Plan: &plan, }, true, nil) }) It("succeeds", func() { Expect(publicPlanErr).ToNot(HaveOccurred()) Expect(planFound).To(BeTrue()) }) It("returns the public plan from the engine", func() { var plan json.RawMessage = []byte("lol") Expect(publicPlan).To(Equal(atc.PublicBuildPlan{ Schema: "some-schema", Plan: &plan, }))