context("Options")
library(rcaspio)
test_that("api_options initializes properly", {
api_options()
expect_equal(api_options("endpoint"), NULL)
expect_equal(api_options("client_id"), NULL)
expect_equal(api_options("client_secret"), NULL)
expect_equal(api_options("access_token"), NULL)
})
test_that("api_options set/get correctly", {
# Endpoint
api_options(endpoint = "my_endpoint")
expect_equal(api_options("endpoint"), "my_endpoint")
expect_equal(api_options("client_id"), NULL)
expect_equal(api_options("client_secret"), NULL)
expect_equal(api_options("access_token"), NULL)
settings::reset(api_options)
expect_equal(api_options("endpoint"), NULL)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.