From 4be815ae2170c0610c6499d00664696bbc0a6b59 Mon Sep 17 00:00:00 2001 From: JT Archie Date: Wed, 20 May 2020 10:35:55 -0600 Subject: [PATCH] fix broken tests --- api/errands_service_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/api/errands_service_test.go b/api/errands_service_test.go index 2ec230e50..ff6df03b9 100644 --- a/api/errands_service_test.go +++ b/api/errands_service_test.go @@ -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"), @@ -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, `{}`), ), ) @@ -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"))) }) }) })