Skip to content

Commit

Permalink
Add acceptance test for getting an empty list of groups of a user
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed May 25, 2018
1 parent 146819b commit 439f9df
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,12 @@ So that I can manage group membership
When user "anotheruser" sends HTTP method "GET" to API endpoint "/cloud/users/newuser/groups"
Then the OCS status code should be "997"
And the HTTP status code should be "401"
And the API should not return any data
And the API should not return any data

Scenario: admin gets groups of an user who is not in any groups
Given user "brand-new-user" has been created
And group "unused-group" has been created
When user "admin" sends HTTP method "GET" to API endpoint "/cloud/users/brand-new-user/groups"
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And the list of groups returned by the API should be empty
13 changes: 13 additions & 0 deletions tests/acceptance/features/bootstrap/Provisioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -1583,6 +1583,19 @@ public function theListOfUsersReturnedByTheApiShouldBeEmpty() {
);
}

/**
* @Then /^the list of groups returned by the API should be empty$/
*
* @return void
*/
public function theListOfGroupsReturnedByTheApiShouldBeEmpty() {
$groupsList = $this->response->xml()->data[0]->groups[0];
PHPUnit_Framework_Assert::assertEmpty(
$groupsList,
"Groups list is not empty but it should be empty"
);
}

/**
* @BeforeScenario
* @AfterScenario
Expand Down

0 comments on commit 439f9df

Please sign in to comment.