tests/testthat/test_rt_user_create.R

context("user/create")

test_that("we can create a new user", {
  user_name <- tolower(paste(sample(LETTERS, 50, TRUE), collapse = ""))
  user_id <- rt_user_create(user_name, "APassword")

  testthat::expect_is(user_id, "numeric")
})

test_that("we throw an error on a failed create", {
  user_name <- tolower(paste(sample(LETTERS, 50, TRUE), collapse = ""))
  user_id <- rt_user_create(user_name, "APassword")

  testthat::expect_error(
    rt_user_create(user_name, "APassword"),
    "Could not create user"
  )
})
amoeba/rt documentation built on March 7, 2020, 10:01 a.m.