Skip to content

Commit

Permalink
Merge pull request #384 from cloudfoundry/async
Browse files Browse the repository at this point in the history
Show blank last operation if the CC returns null last_operation in API response.
  • Loading branch information
jberkhahn committed Mar 27, 2015
2 parents e76c3ea + 44950f1 commit 4d9f32b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cf/commands/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func ServiceInstanceStateToStatus(operationType string, state string, isUserProv
return T("{{.OperationType}} in progress", map[string]interface{}{"OperationType": operationType})
case "failed":
return T("{{.OperationType}} failed", map[string]interface{}{"OperationType": operationType})
case "succeeded", "":
case "succeeded":
return T("{{.OperationType}} succeeded", map[string]interface{}{"OperationType": operationType})
default:
return ""
Expand Down
8 changes: 4 additions & 4 deletions cf/commands/service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ var _ = Describe("service command", func() {
Expect(requirementsFactory.ServiceInstanceName).To(Equal("service1"))
})

It("shows status: `create succeeded` when state is ``", func() {
It("shows status: `` when state is ``", func() {
createServiceInstanceWithState("")
runCommand("service1")

Expect(ui.Outputs).To(ContainSubstrings(
[]string{"Status: ", "create succeeded"},
[]string{"Status: ", ""},
))
Expect(requirementsFactory.ServiceInstanceName).To(Equal("service1"))
})
Expand Down Expand Up @@ -196,9 +196,9 @@ var _ = Describe("ServiceInstanceStateToStatus", func() {
Expect(status).To(Equal("create failed"))
})

It("returns status: `create succeeded` when state: ``", func() {
It("returns status: `` when state: ``", func() {
status := ServiceInstanceStateToStatus(operationType, "", isUserProvided)
Expect(status).To(Equal("create succeeded"))
Expect(status).To(Equal(""))
})
})
})
Expand Down
2 changes: 1 addition & 1 deletion cf/commands/service/services_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ var _ = Describe("services", func() {
[]string{"name", "service", "plan", "bound apps", "last operation"},
[]string{"OK"},
[]string{"my-service-1", "cleardb", "spark", "cli1, cli2", "create in progress"},
[]string{"my-service-2", "cleardb", "spark-2", "cli1", "create succeeded"},
[]string{"my-service-2", "cleardb", "spark-2", "cli1", ""},
[]string{"my-service-provided-by-user", "user-provided", "", "", ""},
))
})
Expand Down

0 comments on commit 4d9f32b

Please sign in to comment.