Describe("when pushing a new app", func() { BeforeEach(func() { appRepo.ReadReturns.Error = errors.NewModelNotFoundError("App", "the-app") zipper.ZipReturns(nil) zipper.GetZipSizeReturns(9001, nil) actor.GatherFilesReturns(nil, true, nil) actor.UploadAppReturns(nil) }) It("does not call Zip() when there is no file to be uploaded", func() { actor.GatherFilesReturns(nil, false, nil) callPush("my-new-app") Expect(zipper.ZipCallCount()).To(Equal(0)) }) Context("when the default route for the app already exists", func() { BeforeEach(func() { route := models.Route{} route.Guid = "my-route-guid" route.Host = "my-new-app" route.Domain = domainRepo.ListDomainsForOrgDomains[0] routeRepo.FindByHostAndDomainReturns.Route = route }) It("binds to existing routes", func() { callPush("my-new-app")