provisioningContext.ServiceId = "service-1"
			provisioningContext.PlanId = "plan-1"
		})

		Context("when all goes ok", func() {
			BeforeEach(func() {
				err := provisioningController.Create(provisioningContext)
				Expect(err).ToNot(HaveOccurred())
			})

			It("responds with 201", func() {
				Expect(goaContext.ResponseStatus()).To(Equal(201))
			})

			It("sends the correct message to the state", func() {
				recordedInstance := state.AddInstanceArgsForCall(0)
				Expect(recordedInstance.ID).To(Equal("some-instance-id"))
				Expect(recordedInstance.OrganizationID).To(Equal("org-1"))
				Expect(recordedInstance.SpaceID).To(Equal("space-1"))
				Expect(recordedInstance.ServiceID).To(Equal("service-1"))
				Expect(recordedInstance.PlanID).To(Equal("plan-1"))
			})
		})

		Context("when the instance id already exists", func() {
			BeforeEach(func() {
				state.InstanceExistsReturns(true)

				err := provisioningController.Create(provisioningContext)
				Expect(err).ToNot(HaveOccurred())
			})