context('Test that qrc_query can communicate with database')
test_that('Query for rocre gets expected outcome', {
df <- qrc_query(db = 'qrc_raw',
query = 'select * from rocre limit 1;')
expect_equal(class(df), 'data.frame')
expect_equal(ncol(df), 19)
expect_equal(names(df), roccl_names)
})
test_that('Query for roceq gets expected outcome', {
df <- qrc_query(db = 'qrc_raw',
query = 'select * from roceq limit 1;')
expect_equal(class(df), 'data.frame')
expect_equal(ncol(df), 19)
expect_equal(names(df), roccl_names)
})
test_that('Query for roctm gets expected outcome', {
df <- qrc_query(db = 'qrc_raw',
query = 'select * from roctm limit 1;')
expect_equal(class(df), 'data.frame')
expect_equal(ncol(df), 25)
expect_equal(names(df), roctm_names)
})
test_that('Query for installbase gets expected outcome', {
df <- qrc_query(db = 'qrc_raw',
query = 'select * from installbase limit 1;')
expect_equal(class(df), 'data.frame')
expect_equal(ncol(df), 5)
expect_equal(names(df),
c('region', 'country', 'analyzer', 'yyyymm', 'installbase'))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.