github.com/jghiloni/cli@v6.28.1-0.20170628223758-0ce05fe032a2+incompatible/integration/isolated/set_space_quota_command_test.go (about)

     1  package isolated
     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("set-space-quota command", func() {
    12  	var (
    13  		orgName   string
    14  		spaceName string
    15  		quotaName string
    16  	)
    17  	BeforeEach(func() {
    18  		orgName = helpers.NewOrgName()
    19  		spaceName = helpers.NewSpaceName()
    20  
    21  		setupCF(orgName, spaceName)
    22  		quotaName = helpers.QuotaName()
    23  		session := helpers.CF("create-space-quota", quotaName)
    24  		Eventually(session).Should(Exit(0))
    25  	})
    26  
    27  	It("sets the space quota on a space", func() {
    28  		session := helpers.CF("set-space-quota", spaceName, quotaName)
    29  		Eventually(session).Should(Say("Assigning space quota %s to space %s", quotaName, spaceName))
    30  		Eventually(session).Should(Exit(0))
    31  
    32  		session = helpers.CF("space", spaceName)
    33  		Eventually(session).Should(Say("(?i)space quota:\\s+%s", quotaName))
    34  		Eventually(session).Should(Exit(0))
    35  	})
    36  })