goaContext = goa.NewContext(gctx, &req, responseWriter, params, payload) }) Describe("#Create", func() { var provisioningContext *app.CreateProvisioningContext BeforeEach(func() { var err error provisioningContext, err = app.NewCreateProvisioningContext(goaContext) Expect(err).ToNot(HaveOccurred()) provisioningContext.InstanceId = "some-instance-id" provisioningContext.OrganizationId = "org-1" provisioningContext.SpaceId = "space-1" 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)