code.cloudfoundry.org/cli@v7.1.0+incompatible/cf/models/domain_test.go (about)

     1  package models_test
     2  
     3  import (
     4  	. "code.cloudfoundry.org/cli/cf/models"
     5  	. "github.com/onsi/ginkgo"
     6  	. "github.com/onsi/gomega"
     7  )
     8  
     9  var _ = Describe("DomainFields", func() {
    10  	var route Route
    11  
    12  	BeforeEach(func() {
    13  		route = Route{}
    14  
    15  		domain := DomainFields{}
    16  		domain.Name = "example.com"
    17  		route.Domain = domain
    18  	})
    19  
    20  	It("uses the hostname as part of the URL", func() {
    21  		route.Host = "foo"
    22  		Expect(route.URL()).To(Equal("foo.example.com"))
    23  	})
    24  
    25  	It("omits the hostname when none is given", func() {
    26  		Expect(route.URL()).To(Equal("example.com"))
    27  	})
    28  })