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 restrictSharingOutsideTheGroup #31715

Merged
merged 1 commit into from
Jun 12, 2018

Conversation

paurakhsharma
Copy link
Member

Description

This PR adds test to check the behavior of sharing API when sharing outside the group has been restricted

Related Issue

#31531

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.

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.

Tests look good. Just some indent, and a comment about DRY code.

And the OCS status code should be "403"
And the HTTP status code should be "200"

Scenario: user shares a file with user who is in his group when sharing outside the group has been restricted
Copy link
Contributor

Choose a reason for hiding this comment

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

Indenting problem

And the OCS status code should be "100"
And the HTTP status code should be "200"

Scenario: user tries to share a file with the group he is not member of when sharing outside the group has been restricted
Copy link
Contributor

Choose a reason for hiding this comment

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

Indenting problem

And the OCS status code should be "404"
And the HTTP status code should be "200"

Scenario: user shares a file with the group he is member of when sharing outside the group has been restricted
Copy link
Contributor

Choose a reason for hiding this comment

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

Indenting problem

}

/**
* @Then /^user "([^"]*)" should be able to share (?:file|folder|entry) "([^"]*)" with group "([^"]*)"(?: with permissions ([\d]*))? using the API$/
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make a single function with (user|group) then decide the 0|1 parameter to createShare() based on that?
It would save repeating all the other code around the createShare() calll.

@codecov
Copy link

codecov bot commented Jun 11, 2018

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #31715   +/-   ##
=========================================
  Coverage     63.14%   63.14%           
  Complexity    18438    18438           
=========================================
  Files          1158     1158           
  Lines         69259    69259           
  Branches       1260     1260           
=========================================
  Hits          43733    43733           
  Misses        25157    25157           
  Partials        369      369
Flag Coverage Δ Complexity Δ
#javascript 52.39% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 64.37% <ø> (ø) 18438 <ø> (ø) ⬇️

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 8ed293b...7715908. Read the comment docs.

@paurakhsharma paurakhsharma force-pushed the API-test-sharing-restrictSharingOutsideTheGroup branch from 32323c2 to 7715908 Compare June 12, 2018 09:39
@phil-davis phil-davis merged commit 7909d43 into master Jun 12, 2018
@phil-davis phil-davis deleted the API-test-sharing-restrictSharingOutsideTheGroup branch June 12, 2018 10:29
@paurakhsharma
Copy link
Member Author

Backport on #31736

@lock
Copy link

lock bot commented Jul 31, 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 31, 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.

3 participants