diff --git a/tests/integration/features/identify-account/search.feature b/tests/integration/features/identify-account/search.feature index 8805ec5c4..b13286337 100644 --- a/tests/integration/features/identify-account/search.feature +++ b/tests/integration/features/identify-account/search.feature @@ -1,10 +1,8 @@ Feature: search - Background: Create users - Given user "search-signer1" exists - Given user "search-signer2" exists - Scenario: Search account by specific user Given as user "admin" + And user "search-signer1" exists + And user "search-signer2" exists When sending "get" to ocs "/apps/libresign/api/v1/identify-account/search?search=search-signer1" Then the response should have a status code 200 And the response should be a JSON array with the following mandatory values @@ -19,6 +17,8 @@ Feature: search Scenario: Search account by multiple users Given as user "admin" + And user "search-signer1" exists + And user "search-signer2" exists When sending "get" to ocs "/apps/libresign/api/v1/identify-account/search?search=search-signer" Then the response should have a status code 200 And the response should be a JSON array with the following mandatory values @@ -40,32 +40,37 @@ Feature: search Scenario: Search account by herself with partial name search Given as user "admin" - And set the email of user "admin" to "admin@email.tld" - When sending "get" to ocs "/apps/libresign/api/v1/identify-account/search?search=adm" + And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods" + | value | (string)[{"name":"account","enabled":true}] | + And user "can-find-myself" exists + And run the command "group:adduser admin can-find-myself" with result code 0 + And set the email of user "can-find-myself" to "my@email.tld" + When sending "get" to ocs "/apps/libresign/api/v1/identify-account/search?search=can-" Then the response should have a status code 200 And the response should be a JSON array with the following mandatory values - | key | value | - | (jq).ocs.data\|length | 1 | - | (jq).ocs.data[0].id | admin | - | (jq).ocs.data[0].isNoUser | false | - | (jq).ocs.data[0].displayName | admin | - | (jq).ocs.data[0].subname | admin@email.tld | - | (jq).ocs.data[0].icon | icon-user | - | (jq).ocs.data[0].shareType | 0 | + | key | value | + | (jq).ocs.data\|length | 1 | + | (jq).ocs.data[0].id | can-find-myself | + | (jq).ocs.data[0].isNoUser | false | + | (jq).ocs.data[0].displayName | can-find-myself-displayname | + | (jq).ocs.data[0].subname | my@email.tld | + | (jq).ocs.data[0].icon | icon-user | + | (jq).ocs.data[0].shareType | 0 | Scenario: Search account by herself without permission to identify by account Given as user "admin" And sending "post" to ocs "/apps/provisioning_api/api/v1/config/apps/libresign/identify_methods" | value | (string)[{"name":"email","enabled":true}] | - And set the display name of user "admin" to "Temporary Name" - And set the email of user "admin" to "my@email.tld" - And sending "get" to ocs "/apps/libresign/api/v1/identify-account/search?search=admin" + Given user "cant-find-myself" exists + And run the command "group:adduser admin cant-find-myself" with result code 0 + And set the display name of user "cant-find-myself" to "Temporary Name" + And set the email of user "cant-find-myself" to "my@email.tld" + When as user "cant-find-myself" + And sending "get" to ocs "/apps/libresign/api/v1/identify-account/search?search=cant-find-myself" Then the response should have a status code 200 And the response should be a JSON array with the following mandatory values | key | value | | (jq).ocs.data\|length | 0 | - And set the email of user "admin" to "admin@email.tld" - And set the display name of user "admin" to "admin" Scenario: Search account by herself with permission to identify by account Given as user "admin"