github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/integration/v6/isolated/check_route_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("check-route command", func() {
    12  	var (
    13  		orgName   string
    14  		spaceName string
    15  		route     helpers.Route
    16  	)
    17  	BeforeEach(func() {
    18  		orgName = helpers.NewOrgName()
    19  		spaceName = helpers.NewSpaceName()
    20  
    21  		helpers.SetupCF(orgName, spaceName)
    22  		route = helpers.NewRoute(spaceName, helpers.DefaultSharedDomain(), "integration", "")
    23  	})
    24  
    25  	AfterEach(func() {
    26  		helpers.QuickDeleteOrg(orgName)
    27  	})
    28  
    29  	It("checks routes", func() {
    30  		session := helpers.CF("check-route", route.Host, route.Domain)
    31  		Eventually(session).Should(Say("Route %s.%s does not exist", route.Host, route.Domain))
    32  		Eventually(session).Should(Exit(0))
    33  
    34  		route.Create()
    35  
    36  		session = helpers.CF("check-route", route.Host, route.Domain)
    37  		Eventually(session).Should(Say("Route %s.%s does exist", route.Host, route.Domain))
    38  		Eventually(session).Should(Exit(0))
    39  	})
    40  })