From 505a569d27b85af0cd1eb39f67104a304cf356ae Mon Sep 17 00:00:00 2001 From: jennybc Date: Wed, 27 May 2015 16:15:39 -0700 Subject: [PATCH] add private sheet, owned by rpackagetest we should NOT be able to access this after we revoke authorization during testing --- internal-projects/14_create-cars-pvt-sheet.R | 16 ++++++++++++++++ tests/testthat/helper01_setup-sheets.R | 9 +++++++++ 2 files changed, 25 insertions(+) create mode 100644 internal-projects/14_create-cars-pvt-sheet.R diff --git a/internal-projects/14_create-cars-pvt-sheet.R b/internal-projects/14_create-cars-pvt-sheet.R new file mode 100644 index 0000000..6d69956 --- /dev/null +++ b/internal-projects/14_create-cars-pvt-sheet.R @@ -0,0 +1,16 @@ +#' --- +#' output: md_document +#' --- + +library("googlesheets") +suppressPackageStartupMessages(library("dplyr")) + +## damn you render and your hard-wiring of wd = dir where file lives! +## if I don't commit this abomination, existing .httr-oauth cannot be found :( +if ((getwd() %>% basename) == "data-for-demo") { + setwd("..") +} + +cars_ss <- gs_new("test-gs-cars-private", ws_title = "cars", + input = head(mtcars), header = TRUE, trim = TRUE) +cars_ss diff --git a/tests/testthat/helper01_setup-sheets.R b/tests/testthat/helper01_setup-sheets.R index 8021e6e..52f0d3d 100644 --- a/tests/testthat/helper01_setup-sheets.R +++ b/tests/testthat/helper01_setup-sheets.R @@ -76,3 +76,12 @@ iris_pvt_url <- "https://docs.google.com/spreadsheets/d/1UXr4-haIQsmJfyjkEhlkNt2 iris_pvt_title <- "test-gs-iris-private" iris_pvt_key <- "1UXr4-haIQsmJfyjkEhlkNt2PXduBkB97e15jez9ogRo" iris_pvt_ws_feed <- "https://spreadsheets.google.com/feeds/worksheets/1UXr4-haIQsmJfyjkEhlkNt2PXduBkB97e15jez9ogRo/private/full" + +## Private cars sheet (owned by rpackagetest) +cars_pvt_url <- "https://docs.google.com/spreadsheets/d/1rC2qjB8VE50kTkHZL5PY_DHVc9foRLI8ixKLr8a0a9Y/" +cars_pvt_title <- "test-gs-cars-private" +cars_pvt_key <- cars_pvt_url %>% + extract_key_from_url() +cars_pvt_ws_feed <- cars_pvt_url %>% + extract_key_from_url() %>% + construct_ws_feed_from_key()