From dedeb0725d64baecdd053820533022da04193940 Mon Sep 17 00:00:00 2001 From: Dillon Kearns Date: Sun, 19 Apr 2020 10:35:17 -0700 Subject: [PATCH] Add a test case. --- tests/StaticHttpRequestsTests.elm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/StaticHttpRequestsTests.elm b/tests/StaticHttpRequestsTests.elm index e9d535f1..761974b5 100644 --- a/tests/StaticHttpRequestsTests.elm +++ b/tests/StaticHttpRequestsTests.elm @@ -630,6 +630,33 @@ Body: """) ] ) ] + , test "it ignores unused cache" <| + \() -> + startWithHttpCache + [ ( { url = "https://this-is-never-used.example.com/" + , method = "GET" + , headers = [] + , body = StaticHttpBody.EmptyBody + } + , """{"stargazer_count":86}""" + ) + ] + [ ( [] + , StaticHttp.get (Secrets.succeed "https://api.github.com/repos/dillonkearns/elm-pages") starDecoder + ) + ] + |> ProgramTest.simulateHttpOk + "GET" + "https://api.github.com/repos/dillonkearns/elm-pages" + """{ "stargazer_count": 86 }""" + |> expectSuccess + [ ( "" + , [ ( get "https://api.github.com/repos/dillonkearns/elm-pages" + , """{"stargazer_count":86}""" + ) + ] + ) + ] ] ]