Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
hillalex committed Sep 26, 2024
1 parent f1ad4ab commit e0760dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/router.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ build_routes <- function(cookie_key = plumber::random_cookie_key(),
package = "serovizr")),
eval.expr = FALSE)
pr$setApiSpec(api)
require(redoc)
library(redoc)
pr$setDocs("redoc")
pr$mount("/schema", plumber::PlumberStatic$new(file.path(system.file("schema",
package = "serovizr"))))
Expand Down
5 changes: 3 additions & 2 deletions tests/testthat/test-router.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ test_that("DELETE /dataset", {
expect_equal(body$data, "testdataset")
})

test_that("DELETE /dataset returns 404 if not found", {
test_that("DELETE /dataset returns 200 if dataset doesn't exist", {
router <- build_routes(cookie_key)
res <- router$call(make_req("DELETE",
"/dataset/testdataset/",
HTTP_COOKIE = cookie))
expect_equal(res$status, 404)
expect_equal(res$status, 200)
expect_equal(body$data, "testdataset")
})

test_that("GET /datasets", {
Expand Down

0 comments on commit e0760dc

Please sign in to comment.