Skip to content

Commit

Permalink
addressed review
Browse files Browse the repository at this point in the history
  • Loading branch information
sushmita56 committed Mar 11, 2022
1 parent 84e627f commit a532a84
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ Feature: a default expiration date can be specified for shares with users or gro
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "yes"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a share using the sharing API with settings
And user "Alice" has created a share with settings
| path | /FOLDER |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
| expireDate | +15 days |
And the administrator has set parameter "shareapi_default_expire_date_user_share" of app "core" to "no"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "no"
When user "Alice" gets the info of the last share using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
Expand All @@ -111,12 +111,12 @@ Feature: a default expiration date can be specified for shares with users or gro
And parameter "shareapi_enforce_expire_date_user_share" of app "core" has been set to "yes"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a share using the sharing API with settings
And user "Alice" has created a share with settings
| path | /FOLDER |
| shareType | user |
| shareWith | Brian |
| permissions | read,share |
And the administrator has set parameter "shareapi_default_expire_date_user_share" of app "core" to "no"
And parameter "shareapi_default_expire_date_user_share" of app "core" has been set to "no"
When user "Alice" gets the info of the last share using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "<http_status_code>"
Expand Down Expand Up @@ -218,7 +218,7 @@ Feature: a default expiration date can be specified for shares with users or gro
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a share using the sharing API with settings
And user "Alice" has created a share with settings
| path | /FOLDER |
| shareType | group |
| shareWith | grp1 |
Expand Down Expand Up @@ -250,7 +250,7 @@ Feature: a default expiration date can be specified for shares with users or gro
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has created folder "FOLDER"
And user "Alice" has created a share using the sharing API with settings
And user "Alice" has created a share with settings
| path | /FOLDER |
| shareType | group |
| shareWith | grp1 |
Expand Down Expand Up @@ -329,7 +329,7 @@ Feature: a default expiration date can be specified for shares with users or gro
When user "Alice" shares file "textfile0.txt" with user "Brian" using the sharing API
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
Then the fields of the last response to user "Alice" sharing with user "Brian" should include
And the fields of the last response to user "Alice" sharing with user "Brian" should include
| share_type | user |
| file_target | /textfile0.txt |
| uid_owner | %username% |
Expand Down Expand Up @@ -378,7 +378,7 @@ Feature: a default expiration date can be specified for shares with users or gro
And user "Alice" gets the info of the last share using the sharing API
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
Then the fields of the last response to user "Alice" should include
And the fields of the last response to user "Alice" should include
| expiration | +30 days |
Examples:
| ocs_api_version | ocs_status_code |
Expand All @@ -398,7 +398,7 @@ Feature: a default expiration date can be specified for shares with users or gro
And user "Alice" gets the info of the last share using the sharing API
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
Then the fields of the last response to user "Alice" should include
And the fields of the last response to user "Alice" should include
| expiration | +30 days |
Examples:
| ocs_api_version | ocs_status_code |
Expand All @@ -415,9 +415,9 @@ Feature: a default expiration date can be specified for shares with users or gro
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "/textfile0.txt"
When user "Alice" shares file "textfile0.txt" with group "grp1" using the sharing API
# Then the HTTP status code should be "<http_status_code>"
# And the OCS status code should be "404"
Then the fields of the last response to user "Alice" sharing with group "grp1" should include
Then the HTTP status code should be "200"
And the OCS status code should be "<ocs_status_code>"
And the fields of the last response to user "Alice" sharing with group "grp1" should include
| share_type | group |
| file_target | /textfile0.txt |
| uid_owner | %username% |
Expand All @@ -426,9 +426,9 @@ Feature: a default expiration date can be specified for shares with users or gro
And the response when user "Brian" gets the info of the last share should include
| expiration | +7 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

@skipOnOcV10.3
Scenario Outline: sharing with default expiration date enabled and enforced for groups, user shares with expiration date more than the default
Expand Down Expand Up @@ -542,14 +542,16 @@ Feature: a default expiration date can be specified for shares with users or gro
When user "Alice" shares file "textfile0.txt" with group "grp1" with permissions "read,share" using the sharing API
And the administrator sets parameter "shareapi_expire_after_n_days_group_share" of app "core" to "15"
And user "Alice" gets the info of the last share using the sharing API
Then the fields of the last response to user "Alice" should include
Then the OCS status code of responses on all endpoints should be "<http_status_code>"
And the HTTP status code of responses on all endpoints should be "200"
And the fields of the last response to user "Alice" should include
| expiration | +30 days |
And the response when user "Brian" gets the info of the last share should include
| expiration | +30 days |
Examples:
| ocs_api_version |
| 1 |
| 2 |
| ocs_api_version | http_status_code |
| 1 | 100 |
| 2 | 200 |

@skipOnOcV10.3
Scenario Outline: sharing with default expiration date enforced for users, user shares to a group without setting an expiration date
Expand All @@ -562,16 +564,16 @@ Feature: a default expiration date can be specified for shares with users or gro
And user "Alice" has created folder "FOLDER"
When user "Alice" shares file "FOLDER" with group "grp1" with permissions "read,share" using the sharing API
And user "Alice" gets the info of the last share using the sharing API
Then the OCS status code of responses on all endpoints should be "<http_status_code>"
And the HTTP status code of responses on all endpoints should be "200"
Then the HTTP status code of responses on all endpoints should be "200"
And the OCS status code of responses on all endpoints should be "<ocs_status_code>"
And the fields of the last response to user "Alice" should include
| expiration | |
And the response when user "Brian" gets the info of the last share should include
| expiration | |
Examples:
| ocs_api_version | http_status_code |
| 1 | 100 |
| 2 | 200 |
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

@skipOnOcV10.3
Scenario Outline: sharing with default expiration date enforced for groups, user shares to another user
Expand All @@ -582,16 +584,16 @@ Feature: a default expiration date can be specified for shares with users or gro
And user "Alice" has created folder "FOLDER"
When user "Alice" shares file "/FOLDER" with user "Brian" with permissions "read,share" using the sharing API
And user "Alice" gets the info of the last share using the sharing API
Then the OCS status code of responses on all endpoints should be "<http_status_code>"
And the HTTP status code of responses on all endpoints should be "200"
Then the HTTP status code of responses on all endpoints should be "200"
And the OCS status code of responses on all endpoints should be "<ocs_status_code>"
And the fields of the last response to user "Alice" should include
| expiration | |
And the response when user "Brian" gets the info of the last share should include
| expiration | |
Examples:
| ocs_api_version | http_status_code |
| 1 | 100 |
| 2 | 200 |
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |

@skipOnOcV10.3
Scenario Outline: sharing with default expiration date enforced for users, user shares with invalid expiration date set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ Feature: resources shared with the same name are received with unique names
And user "Brian" shares folder "/foo" with user "Carol" using the sharing API
Then the OCS status code of responses on all endpoints should be "100"
And the HTTP status code of responses on all endpoints should be "200"
Then user "Carol" should see the following elements
| /foo/ |
And user "Carol" should see the following elements
| /foo/ |
| /foo (2)/ |
20 changes: 0 additions & 20 deletions tests/acceptance/features/bootstrap/AppConfigurationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,6 @@ public function adminSetsServerParameterToUsingAPI(
$this->modifyAppConfig($app, $parameter, $value);
}

/**
* @Given the administrator has set parameter :arg1 of app :arg2 to :arg3
*
* @param string $parameter
* @param string $app
* @param string $value
*
* @return void
*/
public function theAdministratorHasSetParameterOfAppTo(
string $parameter,
string $app,
string $value
):void {
// The capturing group of the regex always includes the quotes at each
// end of the captured string, so trim them.
$value = \trim($value, $value[0]);
$this->modifyAppConfig($app, $parameter, $value);
}

/**
* @Given /^parameter "([^"]*)" of app "([^"]*)" has been set to ((?:'[^']*')|(?:"[^"]*"))$/
*
Expand Down
17 changes: 0 additions & 17 deletions tests/acceptance/features/bootstrap/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,23 +325,6 @@ public function userCreatesAShareWithSettings(string $user, ?TableNode $body):vo
);
}

/**
* @Given user :arg1 has created a share using the sharing API with settings
*
* @param string $user
* @param TableNode|null $body {@link createShareWithSettings}
*
* @return void
* @throws Exception
*/
public function userHasCreatedAShareUsingTheSharingApiWithSettings(string $user, ?TableNode $body):void {
$user = $this->getActualUsername($user);
$this->createShareWithSettings(
$user,
$body
);
}

/**
* @Given /^user "([^"]*)" has created a share with settings$/
*
Expand Down

0 comments on commit a532a84

Please sign in to comment.