github.com/sleungcy-sap/cli@v7.1.0+incompatible/integration/v7/global/disable_feature_flag_command_test.go (about) 1 package global 2 3 import ( 4 "code.cloudfoundry.org/cli/integration/helpers" 5 . "github.com/onsi/ginkgo" 6 . "github.com/onsi/gomega" 7 . "github.com/onsi/gomega/gbytes" 8 . "github.com/onsi/gomega/gexec" 9 ) 10 11 var _ = Describe("disable-feature-flags command", func() { 12 13 Describe("help", func() { 14 When("--help flag is set", func() { 15 It("Displays command usage to output", func() { 16 session := helpers.CF("disable-feature-flag", "--help") 17 Eventually(session).Should(Say("NAME:")) 18 Eventually(session).Should(Say("disable-feature-flag - Prevent use of a feature")) 19 Eventually(session).Should(Say("USAGE:")) 20 Eventually(session).Should(Say("cf disable-feature-flag FEATURE_FLAG_NAME")) 21 Eventually(session).Should(Say("SEE ALSO:")) 22 Eventually(session).Should(Say("enable-feature-flag, feature-flag, feature-flags")) 23 Eventually(session).Should(Exit(0)) 24 }) 25 }) 26 }) 27 28 BeforeEach(func() { 29 helpers.LoginCF() 30 }) 31 32 AfterEach(func() { 33 session := helpers.CF("enable-feature-flag", "private_domain_creation") 34 Eventually(session).Should(Exit(0)) 35 }) 36 37 It("enables a feature flag", func() { 38 session := helpers.CF("disable-feature-flag", "private_domain_creation") 39 Eventually(session).Should(Say("Disabling feature flag private_domain_creation as")) 40 Eventually(session).Should(Say("OK")) 41 Eventually(session).Should(Exit(0)) 42 43 session = helpers.CF("feature-flag", "private_domain_creation") 44 Eventually(session).Should(Say(`private_domain_creation\s+disabled`)) 45 Eventually(session).Should(Exit(0)) 46 }) 47 })