Skip to content

Commit

Permalink
integration tests for #152, #153
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed May 22, 2024
1 parent f74f78a commit 7f4ae34
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/testthat/test_communities.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,19 @@ test_that("community is retrieved by id",{
expect_equal(zen_community$slug, "fisheries")
expect_equal(zen_community$metadata$title, "Fisheries and aquaculture")
Sys.sleep(2)
})

test_that("record is submitted to a community, with cancel and review actions (decline, accept) performed",{
rec <- ZENODO$getDepositionByDOI("10.5072/zenodo.54894")
req = ZENODO$submitRecordToCommunities(record = rec, communities = "openfair")
#cancel request (for user that submitted the record)
canceled = ZENODO$cancelRequest(req$processed[[1]]$request_id)
expect_true(canceled)
#submit again (new review)
req = ZENODO$submitRecordToCommunities(record = rec, communities = "openfair")
declined = ZENODO$declineRequest(req$processed[[1]]$request_id, message = "Please explain why you want to add zen4R to 'Open Fair' community")
expect_true(declined)
#submit again (new review)
req = ZENODO$submitRecordToCommunities(record = rec, communities = "openfair", message = "zen4R supports FAIR principles")
accepted = ZENODO$acceptRequest(req$processed[[1]]$request_id, message = "Thank you, welcome to the Open FAIR community")
})

0 comments on commit 7f4ae34

Please sign in to comment.