diff --git a/tests/testthat/test-req_auth_api_key.R b/tests/testthat/test-req_auth_api_key.R index e164927..5b091a1 100644 --- a/tests/testthat/test-req_auth_api_key.R +++ b/tests/testthat/test-req_auth_api_key.R @@ -36,16 +36,17 @@ test_that("req_auth_api_key works for query", { api_key = "my_key", location = "query" ) - # As of 2025-01-20, httr2 on macos did not insert the "/", but all other OSs - # did. Normalizing manually here. + # In httr2 <=1.0.7, path can be NULL. in 1.1.0+, path is normalized to at + # least "/". Normalize to make sure this test passes in both of those + # versions. test_result$url <- stringr::str_replace( test_result$url, - stringr::fixed("/?parm"), - stringr::fixed("?parm") + stringr::fixed("example.com?parm"), + stringr::fixed("example.com/?parm") ) expect_identical( test_result$url, - "https://example.com?parm=my_key" + "https://example.com/?parm=my_key" ) })