|
| 1 | +# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors |
| 2 | +# SPDX-License-Identifier: AGPL-3.0-or-later |
| 3 | +Feature: appmanagement |
| 4 | + Background: |
| 5 | + Given using api version "2" |
| 6 | + And user "user1" exists |
| 7 | + And user "user2" exists |
| 8 | + And group "group1" exists |
| 9 | + And user "user1" belongs to group "group1" |
| 10 | + |
| 11 | + Scenario: Enable app and test route |
| 12 | + Given As an "admin" |
| 13 | + And sending "DELETE" to "/cloud/apps/weather_status" |
| 14 | + And app "weather_status" is disabled |
| 15 | + When sending "GET" to "/apps/weather_status/api/v1/location" |
| 16 | + Then the OCS status code should be "998" |
| 17 | + And the HTTP status code should be "404" |
| 18 | + When sending "POST" to "/cloud/apps/weather_status" |
| 19 | + Then the OCS status code should be "200" |
| 20 | + And the HTTP status code should be "200" |
| 21 | + And app "weather_status" is enabled |
| 22 | + When sending "GET" to "/apps/weather_status/api/v1/location" |
| 23 | + Then the OCS status code should be "200" |
| 24 | + And the HTTP status code should be "200" |
| 25 | + Given As an "user1" |
| 26 | + When sending "GET" to "/apps/weather_status/api/v1/location" |
| 27 | + Then the OCS status code should be "200" |
| 28 | + And the HTTP status code should be "200" |
| 29 | + Given As an "user2" |
| 30 | + When sending "GET" to "/apps/weather_status/api/v1/location" |
| 31 | + Then the OCS status code should be "200" |
| 32 | + And the HTTP status code should be "200" |
| 33 | + |
| 34 | + Scenario: Enable app only for some groups |
| 35 | + Given As an "admin" |
| 36 | + And sending "DELETE" to "/cloud/apps/weather_status" |
| 37 | + And app "weather_status" is disabled |
| 38 | + When sending "GET" to "/apps/weather_status/api/v1/location" |
| 39 | + Then the OCS status code should be "998" |
| 40 | + And the HTTP status code should be "404" |
| 41 | + Given invoking occ with "app:enable weather_status --groups group1" |
| 42 | + Then the command was successful |
| 43 | + Given As an "user2" |
| 44 | + When sending "GET" to "/apps/weather_status/api/v1/location" |
| 45 | + Then the HTTP status code should be "412" |
| 46 | + Given As an "user1" |
| 47 | + When sending "GET" to "/apps/weather_status/api/v1/location" |
| 48 | + Then the OCS status code should be "200" |
| 49 | + And the HTTP status code should be "200" |
| 50 | + Given As an "admin" |
| 51 | + And sending "DELETE" to "/cloud/apps/weather_status" |
| 52 | + And app "weather_status" is disabled |
0 commit comments