aboutsummaryrefslogtreecommitdiffstats
path: root/build/integration/routing_features/apps-and-routes.feature
blob: 954ea73bfacf318bd56377f1d17614fc990a17d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
Feature: appmanagement
  Background:
    Given using api version "2"
    And user "user1" exists
    And user "user2" exists
    And group "group1" exists
    And user "user1" belongs to group "group1"

  Scenario: Enable app and test route
    Given As an "admin"
    And sending "DELETE" to "/cloud/apps/weather_status"
    And app "weather_status" is disabled
    When sending "GET" to "/apps/weather_status/api/v1/location"
    Then the OCS status code should be "998"
    And the HTTP status code should be "404"
    When sending "POST" to "/cloud/apps/weather_status"
    Then the OCS status code should be "200"
    And the HTTP status code should be "200"
    And app "weather_status" is enabled
    When sending "GET" to "/apps/weather_status/api/v1/location"
    Then the OCS status code should be "200"
    And the HTTP status code should be "200"
    Given As an "user1"
    When sending "GET" to "/apps/weather_status/api/v1/location"
    Then the OCS status code should be "200"
    And the HTTP status code should be "200"
    Given As an "user2"
    When sending "GET" to "/apps/weather_status/api/v1/location"
    Then the OCS status code should be "200"
    And the HTTP status code should be "200"

  Scenario: Enable app only for some groups
    Given As an "admin"
    And sending "DELETE" to "/cloud/apps/weather_status"
    And app "weather_status" is disabled
    When sending "GET" to "/apps/weather_status/api/v1/location"
    Then the OCS status code should be "998"
    And the HTTP status code should be "404"
    Given invoking occ with "app:enable weather_status --groups group1"
    Then the command was successful
    Given As an "user2"
    When sending "GET" to "/apps/weather_status/api/v1/location"
    Then the HTTP status code should be "412"
    Given As an "user1"
    When sending "GET" to "/apps/weather_status/api/v1/location"
    Then the OCS status code should be "200"
    And the HTTP status code should be "200"
    Given As an "admin"
    And sending "DELETE" to "/cloud/apps/weather_status"
    And app "weather_status" is disabled