-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from molgenis/feat/create-project-with-userlist
Feat/create project with userlist
- Loading branch information
Showing
4 changed files
with
68 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,51 @@ test_that("armadillo.create_project creates a folder", { | |
stub_registry_clear() | ||
}) | ||
|
||
test_that("armadillo.create_project with users", { | ||
stub_request("put", uri = "https://test.nl/access/projects") %>% | ||
wi_th( | ||
headers = list( | ||
"Accept" = | ||
"application/json, text/xml, application/xml, */*", | ||
"Content-Type" = "application/json"), | ||
body = '{"name":"project","users":["[email protected]","[email protected]"]}' | ||
) %>% | ||
to_return( | ||
status = 204 | ||
) | ||
|
||
expect_message( | ||
armadillo.create_project( | ||
"project", | ||
list("[email protected]", "[email protected]") | ||
), | ||
"Created project 'project' with users: [email protected], [email protected]" | ||
) | ||
|
||
stub_registry_clear() | ||
}) | ||
|
||
test_that("armadillo.create_project with empty user list", { | ||
stub_request("put", uri = "https://test.nl/access/projects") %>% | ||
wi_th( | ||
headers = list( | ||
"Accept" = | ||
"application/json, text/xml, application/xml, */*", | ||
"Content-Type" = "application/json"), | ||
body = '{"name":"project"}' | ||
) %>% | ||
to_return( | ||
status = 204 | ||
) | ||
|
||
expect_message( | ||
armadillo.create_project("project", list()), | ||
"Created project 'project' without users" | ||
) | ||
|
||
stub_registry_clear() | ||
}) | ||
|
||
test_that("armadillo.list_projects lists all shared buckets", { | ||
stub_request("get", uri = "https://test.nl/access/projects") %>% | ||
to_return( | ||
|