Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/integration-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
- 'openldap_numerical_features'
- 'ldap_features'
- 'remoteapi_features'
- 'routing_features'
- 'setup_features'
- 'sharees_features'
- 'sharing_features'
Expand Down
12 changes: 11 additions & 1 deletion build/integration/config/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,14 @@ default:
admin:
- admin
- admin
regular_user_password: 123456
regular_user_password: 123456
routing:
paths:
- "%paths.base%/../routing_features"
contexts:
- RoutingContext:
baseUrl: http://localhost:8080
admin:
- admin
- admin
regular_user_password: 123456
18 changes: 18 additions & 0 deletions build/integration/features/bootstrap/RoutingContext.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;

require __DIR__ . '/../../vendor/autoload.php';

class RoutingContext implements Context, SnippetAcceptingContext {
use Provisioning;
use AppConfiguration;
use CommandLine;

protected function resetAppConfigs(): void {
}
}
52 changes: 52 additions & 0 deletions build/integration/routing_features/apps-and-routes.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
Loading