Skip to content

Commit

Permalink
magrittr pipes
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Sep 4, 2024
1 parent 107d88d commit 9a6662a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/testthat/test-req-cookies.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ test_that("can read/write cookies", {
})

test_that("can set cookies", {
resp <- request(example_url()) |>
req_cookies_set(a = 1, b = 1) |>
req_url_path("/cookies") |>
resp <- request(example_url()) %>%
req_cookies_set(a = 1, b = 1) %>%
req_url_path("/cookies") %>%
req_perform()

expect_equal(resp_body_json(resp), list(cookies = list(a = "1", b = "1")))
})

test_that("cookie values are usually escaped", {
resp <- request(example_url()) |>
req_cookies_set(a = I("%20"), b = "%") |>
req_url_path("/cookies") |>
resp <- request(example_url()) %>%
req_cookies_set(a = I("%20"), b = "%") %>%
req_url_path("/cookies") %>%
req_perform()

expect_equal(resp_body_json(resp), list(cookies = list(a = "%20", b = "%25")))
Expand Down

0 comments on commit 9a6662a

Please sign in to comment.