Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API test for addUser #31315

Merged
merged 1 commit into from
May 2, 2018
Merged

Conversation

paurakhsharma
Copy link
Member

@paurakhsharma paurakhsharma commented May 1, 2018

Description

API test to add user in ownCloud server

Related Issue

#31533

How Has This Been Tested?

Locally

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Acceptance test

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@paurakhsharma paurakhsharma changed the title API test for addUser [WIP] API test for addUser May 1, 2018
Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

@@ -1225,6 +1225,7 @@ public function appShouldBeEnabled($app) {

/**
* @Then /^user "([^"]*)" should be disabled$/
* @When /^the user "([^"]*)" has been disabled$/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this step is not an action, it is a test of the system state.
So we cannot write it as a When.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that does make sense. I will create a new function for it.

Scenario: Create an existing disabled user
Given user "brand-new-user" has been created
When user "admin" sends HTTP method "PUT" to API endpoint "/cloud/users/brand-new-user/disable"
And the user "brand-new-user" has been disabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these 2 steps together, we should write a step:

Given user "brand-new-user" has been disabled

and it should disable the user, and also check that the user is disabled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I should do that

@codecov
Copy link

codecov bot commented May 1, 2018

Codecov Report

Merging #31315 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #31315   +/-   ##
=========================================
  Coverage     62.59%   62.59%           
  Complexity    18227    18227           
=========================================
  Files          1145     1145           
  Lines         68414    68414           
  Branches       1234     1234           
=========================================
  Hits          42821    42821           
  Misses        25232    25232           
  Partials        361      361
Flag Coverage Δ Complexity Δ
#javascript 52.05% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 63.79% <ø> (ø) 18227 <ø> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd2ee83...322e7eb. Read the comment docs.

@paurakhsharma paurakhsharma force-pushed the API-test-addUser branch 3 times, most recently from d769d63 to 789a09a Compare May 1, 2018 09:40
@paurakhsharma paurakhsharma changed the title [WIP] API test for addUser API test for addUser May 1, 2018
Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

Given group "newgroup" has been created
When the administrator sends a user creation request for user "newuser" password "456firstpwd" group "newgroup" using the API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is surprising. For v2 I expect the HTTP status code to be "400" or similar.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't get me started - need to have better / proper api design to move forward in the future

@@ -22,18 +22,10 @@ So that I can more easily manage access to resources by groups rather than indiv
| Finance (NP) | Space and brackets |
| Admin&Finance | Ampersand |
| admin:Pokhara@Nepal | Colon and @ |
| maintenance#123 | Hash sign |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The names with "#" and "%" will work after #31322 is merged. So you can rebase again after that, and remove these addGroup.feature changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#31322 is merged now. So you can rebase and take out the addGroup changes.

@paurakhsharma
Copy link
Member Author

Backport on #31326

@PVince81 PVince81 modified the milestones: development, QA Jun 13, 2018
@lock
Copy link

lock bot commented Jul 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants