Skip to content

Commit

Permalink
fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JT Archie committed May 20, 2020
1 parent bb340ab commit 4be815a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions api/errands_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ var _ = Describe("ErrandsService", func() {
Describe("UpdateStagedProductErrands", func() {
It("sets state for a product's errands", func() {
client.AppendHandlers(
ghttp.CombineHandlers(
ghttp.VerifyRequest("GET", "/api/v0/staged/products/some-product-id/errands"),
ghttp.RespondWith(http.StatusOK, `{
"errands": [{
"name": "some-errand"
}]
}`),
),
ghttp.CombineHandlers(
ghttp.VerifyRequest("PUT", "/api/v0/staged/products/some-product-id/errands"),
ghttp.VerifyContentType("application/json"),
Expand Down Expand Up @@ -85,7 +93,7 @@ var _ = Describe("ErrandsService", func() {
It("returns an error", func() {
client.AppendHandlers(
ghttp.CombineHandlers(
ghttp.VerifyRequest("PUT", "/api/v0/staged/products/some-product-id/errands"),
ghttp.VerifyRequest("GET", "/api/v0/staged/products/some-product-id/errands"),
ghttp.RespondWith(http.StatusTeapot, `{}`),
),
)
Expand All @@ -107,7 +115,7 @@ var _ = Describe("ErrandsService", func() {
client.Close()

err := service.UpdateStagedProductErrands("some-product-id", "some-errand", "true", "false")
Expect(err).To(MatchError(ContainSubstring("failed to set errand state: could not send api request to PUT /api/v0/staged/products/some-product-id/errands")))
Expect(err).To(MatchError(ContainSubstring("could not send api request to GET /api/v0/staged/products/some-product-id/errands")))
})
})
})
Expand Down

0 comments on commit 4be815a

Please sign in to comment.