11test_that(" fetch_survey() returns survey with default params" , {
22 skip_on_cran()
33
4- vcr :: use_cassette(" fetch_survey" , {
5- x <- fetch_survey(" SV_3gbwq8aJgqPwQDP" )
6- })
4+ x <- fetch_survey(" SV_3gbwq8aJgqPwQDP" )
75
86 expect_s3_class(x , c(" spec_tbl_df" , " tbl_df" , " tbl" , " data.frame" ))
97 expect_named(
@@ -47,20 +45,17 @@ test_that("fetch_survey() returns survey with default params", {
4745test_that(" fetch_survey() returns survey with custom params" , {
4846 skip_on_cran()
4947
50- vcr :: use_cassette(" fetch_survey_custom" , {
51- x <-
52- fetch_survey(
53- " SV_3gbwq8aJgqPwQDP" ,
54- start_date = " 2015-01-01" ,
55- end_date = " 2022-06-02 18:40:53" ,
56- unanswer_recode = 999 ,
57- limit = 15 ,
58- include_questions = c(" QID16" , " QID17" ),
59- include_metadata = c(" StartDate" , " EndDate" , " ResponseId" ),
60- breakout_sets = FALSE ,
61- col_types = readr :: cols(EndDate = readr :: col_character())
62- )
63- })
48+ x <- fetch_survey(
49+ " SV_3gbwq8aJgqPwQDP" ,
50+ start_date = " 2015-01-01" ,
51+ end_date = " 2022-06-02 18:40:53" ,
52+ unanswer_recode = 999 ,
53+ limit = 15 ,
54+ include_questions = c(" QID16" , " QID17" ),
55+ include_metadata = c(" StartDate" , " EndDate" , " ResponseId" ),
56+ breakout_sets = FALSE ,
57+ col_types = readr :: cols(EndDate = readr :: col_character())
58+ )
6459
6560 expect_s3_class(x , c(" tbl_df" , " tbl" , " data.frame" ))
6661 expect_equal(nrow(x ), 15 )
@@ -79,19 +74,16 @@ test_that("fetch_survey() returns survey with custom params", {
7974test_that(" fetch_survey() excludes variable classes when requested" , {
8075 skip_on_cran()
8176
82- vcr :: use_cassette(" fetch_survey_exclude" , {
83- x <-
84- fetch_survey(
85- " SV_3gbwq8aJgqPwQDP" ,
86- start_date = " 2015-01-01" ,
87- end_date = " 2022-06-02 18:40:53" ,
88- unanswer_recode = 999 ,
89- limit = 15 ,
90- include_questions = NA ,
91- include_metadata = NA ,
92- breakout_sets = FALSE
93- )
94- })
77+ x <- fetch_survey(
78+ " SV_3gbwq8aJgqPwQDP" ,
79+ start_date = " 2015-01-01" ,
80+ end_date = " 2022-06-02 18:40:53" ,
81+ unanswer_recode = 999 ,
82+ limit = 15 ,
83+ include_questions = NA ,
84+ include_metadata = NA ,
85+ breakout_sets = FALSE
86+ )
9587
9688 expect_s3_class(x , c(" tbl_df" , " tbl" , " data.frame" ))
9789 expect_equal(nrow(x ), 15 )
@@ -102,14 +94,12 @@ test_that("fetch_survey() excludes variable classes when requested", {
10294test_that(" fetch_survey() returns survey with only one QID" , {
10395 skip_on_cran()
10496
105- vcr :: use_cassette(" fetch_one_qid" , {
106- x <- fetch_survey(
107- " SV_3gbwq8aJgqPwQDP" ,
108- limit = 15 ,
109- include_questions = c(" QID17" ),
110- breakout_sets = FALSE
111- )
112- })
97+ x <- fetch_survey(
98+ " SV_3gbwq8aJgqPwQDP" ,
99+ limit = 15 ,
100+ include_questions = c(" QID17" ),
101+ breakout_sets = FALSE
102+ )
113103
114104 expect_s3_class(x , c(" spec_tbl_df" , " tbl_df" , " tbl" , " data.frame" ))
115105 expect_equal(nrow(x ), 15 )
0 commit comments