var _ = Describe("LoadOrganization", func() { var CCServer *httptest.Server var cc cf.CloudController BeforeEach(func() { CCServer = httptest.NewServer(OrganizationsEndpoint) cc = cf.NewCloudController(CCServer.URL, false) }) AfterEach(func() { CCServer.Close() }) It("loads the organization from cloud controller", func() { org, err := cc.LoadOrganization("org-guid", "notification-token") if err != nil { panic(err) } Expect(org.GUID).To(Equal("org-guid")) Expect(org.Name).To(Equal("Initech")) }) It("returns a Failure instance when the org cannot be found", func() { _, err := cc.LoadOrganization("banana", "notification-token") Expect(err).To(BeAssignableToTypeOf(cf.Failure{})) }) })