Beispiel #1
0
			}`)
			ts, handler, repo := createAppRepo([]testnet.TestRequest{createApplicationRequest_withEmptyZone})
			defer ts.Close()

			params := defaultAppParams()
			myZoneName := ""
			params.ZoneName = &myZoneName
			createdApp, apiErr := repo.Create(params)

			Expect(handler).To(HaveAllRequestsCalled())
			Expect(apiErr).NotTo(HaveOccurred())

			app := models.Application{}
			app.Name = "my-cool-app"
			app.Guid = "my-cool-app-guid"
			app.ZoneGuid = ""
			Expect(createdApp).To(Equal(app))
		})

		It("makes the right request with zone", func() {
			createApplicationRequest_withZone := createApplicationRequest
			createApplicationRequest_withZone.Matcher = testnet.RequestBodyMatcher(`{
				"name":"my-cool-app",
				"instances":3,
				"buildpack":"buildpack-url",
				"memory":2048,
				"disk_quota": 512,
				"space_guid":"some-space-guid",
				"stack_guid":"some-stack-guid",
				"command":"some-command",
				"zone_guid":"my-zone-guid"