Skip to content

Commit

Permalink
Merge pull request #55 from NCEAS/dev
Browse files Browse the repository at this point in the history
make sure the award information is unique
  • Loading branch information
Jasmine authored Sep 3, 2021
2 parents 3b2bfd4 + ebd5059 commit c475c25
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/database_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ get_awards <- function(from_date = NULL,
n <- n + 1
}

return(xml_df1)
return(dplyr::distinct(xml_df1, id, .keep_all = T))
}

# TODO make a check_database() function
Expand Down
8 changes: 6 additions & 2 deletions tests/testthat/test_database_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ test_that('we can save the last time the bot ran', {
expect_equal(readLines(file_path), 'text to save')
})

test_that('update_contact_dates wrapper works', {})

test_that('get award works and does not produce duplicates', {
nsf_awards <- awardsBot::get_awards(from_date = '06/25/2021', to_date = "09/02/2021")

expect_equal(nsf_awards$id, unique(nsf_awards$id))
})

test_that('update_contact_dates wrapper works', {})


0 comments on commit c475c25

Please sign in to comment.