diff --git a/DESCRIPTION b/DESCRIPTION index 30a9898..f46dccb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -10,8 +10,8 @@ Description: Provides easier interaction with format and manages throttling by 'Socrata'. Users can upload data to Socrata portals directly from R. -Version: 1.7.2-12 -Date: 2017-03-16 +Version: 1.7.3-2 +Date: 2017-06-22 Author: Hugh Devlin, Ph. D., Tom Schenk, Jr., and John Malc Maintainer: "Tom Schenk Jr." Depends: diff --git a/tests/testthat/test-all.R b/tests/testthat/test-all.R index 712233b..643b690 100644 --- a/tests/testthat/test-all.R +++ b/tests/testthat/test-all.R @@ -98,6 +98,12 @@ test_that("Fields with currency symbols remove the symbol and convert to money", expect_equal("numeric", class(deniro), label="output of money fields") }) +test_that("converts money fields to numeric from Socrata", { + df <- read.socrata("https://data.cityofchicago.org/Administration-Finance/Current-Employee-Names-Salaries-and-Position-Title/xzkq-xp2w") + expect_equal("numeric", class(df$Annual.Salary), label="dollars") + expect_equal("numeric", class(df$Annual.Salary), label="output of money fields") +}) + context("read Socrata") test_that("read Socrata CSV as default", { @@ -461,16 +467,6 @@ test_that("read Socrata JSON that requires a login", { expect_equal(3, nrow(df), label="rows") }) -test_that("converts money fields to numeric", { - # Manual check - money <- "$15000" - numeric_money <- no_deniro(money) - expect_equal(15000, numeric_money, label="dollars") - # Use data from Socrata - df <- read.socrata("https://data.cityofchicago.org/Administration-Finance/Current-Employee-Names-Salaries-and-Position-Title/xzkq-xp2w") - expect_equal("numeric", class(df$Employee.Annual.Salary)) -}) - context("write Socrata datasets") test_that("add a row to a dataset", {