github.com/LukasHeimann/cloudfoundrycli/v8@v8.4.4/integration/v7/global/enable_feature_flag_command_test.go (about)

     1  package global
     2  
     3  import (
     4  	"github.com/LukasHeimann/cloudfoundrycli/v8/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("enable-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("enable-feature-flag", "--help")
    17  				Eventually(session).Should(Say("NAME:"))
    18  				Eventually(session).Should(Say("enable-feature-flag - Allow use of a feature"))
    19  				Eventually(session).Should(Say("USAGE:"))
    20  				Eventually(session).Should(Say("cf enable-feature-flag FEATURE_FLAG_NAME"))
    21  				Eventually(session).Should(Say("SEE ALSO:"))
    22  				Eventually(session).Should(Say("disable-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("disable-feature-flag", "user_org_creation")
    34  		Eventually(session).Should(Exit(0))
    35  	})
    36  
    37  	It("enables a feature flag", func() {
    38  		session := helpers.CF("enable-feature-flag", "user_org_creation")
    39  		Eventually(session).Should(Say("Enabling feature flag user_org_creation as"))
    40  		Eventually(session).Should(Say("OK"))
    41  		Eventually(session).Should(Exit(0))
    42  
    43  		session = helpers.CF("feature-flag", "user_org_creation")
    44  		Eventually(session).Should(Say(`user_org_creation\s+enabled`))
    45  		Eventually(session).Should(Exit(0))
    46  	})
    47  })