github.com/franc20/ayesa_sap@v7.0.0-beta.28.0.20200124003224-302d4d52fa6c+incompatible/integration/v6/global/set_space_role_command_test.go (about) 1 package global 2 3 import ( 4 . "github.com/onsi/ginkgo" 5 . "github.com/onsi/gomega" 6 . "github.com/onsi/gomega/gbytes" 7 . "github.com/onsi/gomega/gexec" 8 9 "code.cloudfoundry.org/cli/integration/helpers" 10 ) 11 12 var _ = Describe("set-space-role command", func() { 13 When("the set_roles_by_username flag is disabled", func() { 14 BeforeEach(func() { 15 helpers.LoginCF() 16 helpers.DisableFeatureFlag("set_roles_by_username") 17 }) 18 19 AfterEach(func() { 20 helpers.EnableFeatureFlag("set_roles_by_username") 21 }) 22 23 When("the user does not exist", func() { 24 It("prints the error from UAA and exits 1", func() { 25 session := helpers.CF("set-space-role", "not-exists", "some-org", "some-space", "SpaceDeveloper") 26 Eventually(session).Should(Say("FAILED")) 27 Eventually(session).Should(Say("User not-exists not found")) 28 Eventually(session).Should(Exit(1)) 29 }) 30 }) 31 }) 32 })