github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/integration/v7/isolated/feature_flag_command_test.go (about) 1 package isolated 2 3 import ( 4 . "code.cloudfoundry.org/cli/cf/util/testhelpers/matchers" 5 "code.cloudfoundry.org/cli/integration/helpers" 6 . "github.com/onsi/ginkgo" 7 . "github.com/onsi/gomega" 8 . "github.com/onsi/gomega/gbytes" 9 . "github.com/onsi/gomega/gexec" 10 ) 11 12 var _ = Describe("feature-flag command", func() { 13 BeforeEach(func() { 14 helpers.LoginCF() 15 }) 16 17 When("--help flag is set", func() { 18 It("appears in cf help -a", func() { 19 session := helpers.CF("help", "-a") 20 Eventually(session).Should(Exit(0)) 21 Expect(session).To(HaveCommandInCategoryWithDescription("feature-flag", "FEATURE FLAGS", "Retrieve an individual feature flag with status")) 22 }) 23 24 It("Displays command usage to output", func() { 25 session := helpers.CF("feature-flag", "--help") 26 27 Eventually(session).Should(Say("NAME:")) 28 Eventually(session).Should(Say("feature-flag - Retrieve an individual feature flag with status")) 29 Eventually(session).Should(Say("USAGE:")) 30 Eventually(session).Should(Say("cf feature-flag FEATURE_FLAG_NAME")) 31 Eventually(session).Should(Say("SEE ALSO:")) 32 Eventually(session).Should(Say("disable-feature-flag, enable-feature-flag, feature-flags")) 33 34 Eventually(session).Should(Exit(0)) 35 }) 36 }) 37 38 It("displays feature flag settings", func() { 39 session := helpers.CF("feature-flag", "user_org_creation") 40 Eventually(session).Should(Say("Getting info for feature flag user_org_creation as")) 41 Eventually(session).Should(Say(`user_org_creation\s+(dis|en)abled`)) 42 Eventually(session).Should(Exit(0)) 43 }) 44 })