github.com/loafoe/cli@v7.1.0+incompatible/integration/v6/push/name_only_client_credentials_test.go (about) 1 package push 2 3 import ( 4 "code.cloudfoundry.org/cli/integration/helpers" 5 6 . "github.com/onsi/ginkgo" 7 . "github.com/onsi/gomega" 8 . "github.com/onsi/gomega/gbytes" 9 . "github.com/onsi/gomega/gexec" 10 ) 11 12 var _ = Describe("push with only an app name when authenticated with client-credentials", func() { 13 var ( 14 appName string 15 clientID string 16 ) 17 18 BeforeEach(func() { 19 appName = helpers.NewAppName() 20 clientID = helpers.LoginCFWithClientCredentials() 21 helpers.TargetOrgAndSpace(organization, space) 22 }) 23 24 AfterEach(func() { 25 helpers.LogoutCF() 26 }) 27 28 Describe("app existence", func() { 29 When("the app does not exist", func() { 30 It("creates the app", func() { 31 helpers.WithHelloWorldApp(func(dir string) { 32 session := helpers.CustomCF(helpers.CFEnv{WorkingDirectory: dir}, PushCommandName, appName) 33 Eventually(session).Should(Say(`Pushing app %s to org %s / space %s as %s\.\.\.`, appName, organization, space, clientID)) 34 Eventually(session).Should(Say(`Getting app info\.\.\.`)) 35 Eventually(session).Should(Say(`Creating app with these attributes\.\.\.`)) 36 Eventually(session).Should(Say(`\+\s+name:\s+%s`, appName)) 37 Eventually(session).Should(Say(`\s+routes:`)) 38 Eventually(session).Should(Say(`(?i)\+\s+%s.%s`, appName, helpers.DefaultSharedDomain())) 39 Eventually(session).Should(Say(`Mapping routes\.\.\.`)) 40 Eventually(session).Should(Say(`Comparing local files to remote cache\.\.\.`)) 41 Eventually(session).Should(Say(`Packaging files to upload\.\.\.`)) 42 Eventually(session).Should(Say(`Uploading files\.\.\.`)) 43 Eventually(session).Should(Say("100.00%")) 44 Eventually(session).Should(Say(`Waiting for API to complete processing files\.\.\.`)) 45 helpers.ConfirmStagingLogs(session) 46 Eventually(session).Should(Say(`Waiting for app to start\.\.\.`)) 47 Eventually(session).Should(Say(`requested state:\s+started`)) 48 Eventually(session).Should(Exit(0)) 49 }) 50 51 session := helpers.CF("app", appName) 52 Eventually(session).Should(Say(`name:\s+%s`, appName)) 53 Eventually(session).Should(Exit(0)) 54 }) 55 }) 56 }) 57 })