github.com/wanddynosios/cli@v7.1.0+incompatible/integration/v6/global/quotas_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("quotas command", func() {
    12  	var (
    13  		quotaName string
    14  
    15  		totalMemory        string
    16  		instanceMemory     string
    17  		routes             string
    18  		serviceInstances   string
    19  		appInstances       string
    20  		reservedRoutePorts string
    21  	)
    22  
    23  	BeforeEach(func() {
    24  		helpers.LoginCF()
    25  		helpers.TargetOrgAndSpace(ReadOnlyOrg, ReadOnlySpace)
    26  		quotaName = helpers.QuotaName()
    27  		totalMemory = "24M"
    28  		instanceMemory = "6M"
    29  		routes = "8"
    30  		serviceInstances = "2"
    31  		appInstances = "3"
    32  		reservedRoutePorts = "1"
    33  		session := helpers.CF("create-quota", quotaName, "-m", totalMemory, "-i", instanceMemory, "-r", routes, "-s", serviceInstances, "-a", appInstances, "--allow-paid-service-plans", "--reserved-route-ports", reservedRoutePorts)
    34  		Eventually(session).Should(Exit(0))
    35  	})
    36  
    37  	It("lists the org quotas", func() {
    38  		session := helpers.CF("quotas")
    39  		Eventually(session).Should(Say(`name\s+total memory\s+instance memory\s+routes\s+service instances\s+paid plans\s+app instances\s+route ports`))
    40  		Eventually(session).Should(Say(`%s\s+%s\s+%s\s+%s\s+%s\s+%s\s+%s\s+%s`, quotaName, totalMemory, instanceMemory, routes, serviceInstances, "allowed", appInstances, reservedRoutePorts))
    41  		Eventually(session).Should(Exit(0))
    42  	})
    43  })