Skip to content

Commit cc04206

Browse files
committed
test(integration): add collect_metadata policy layer coverage
Signed-off-by: Vitor Mattos <[email protected]>
1 parent 331cac4 commit cc04206

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Feature: admin/collect_metadata_policy
2+
Scenario: Manage collect_metadata policy layers through API
3+
Given as user "admin"
4+
And user "signer1" exists
5+
And sending "delete" to ocs "/apps/libresign/api/v1/policies/user/signer1/collect_metadata"
6+
And the response should have a status code 200
7+
8+
When sending "post" to ocs "/apps/libresign/api/v1/policies/system/collect_metadata"
9+
| value | false |
10+
| allowChildOverride | true |
11+
Then the response should have a status code 200
12+
And the response should be a JSON array with the following mandatory values
13+
| key | value |
14+
| (jq).ocs.data.policy.policyKey | collect_metadata |
15+
| (jq).ocs.data.policy.effectiveValue| false |
16+
17+
When sending "put" to ocs "/apps/libresign/api/v1/policies/group/admin/collect_metadata"
18+
| value | true |
19+
| allowChildOverride | true |
20+
Then the response should have a status code 200
21+
And the response should be a JSON array with the following mandatory values
22+
| key | value |
23+
| (jq).ocs.data.policy.policyKey | collect_metadata |
24+
| (jq).ocs.data.policy.scope | group |
25+
| (jq).ocs.data.policy.targetId | admin |
26+
27+
When sending "get" to ocs "/apps/libresign/api/v1/policies/effective"
28+
Then the response should have a status code 200
29+
And the response should be a JSON array with the following mandatory values
30+
| key | value |
31+
| (jq).ocs.data.policies.collect_metadata.effectiveValue | true |
32+
33+
Given as user "signer1"
34+
When sending "get" to ocs "/apps/libresign/api/v1/policies/effective"
35+
Then the response should have a status code 200
36+
And the response should be a JSON array with the following mandatory values
37+
| key | value |
38+
| (jq).ocs.data.policies.collect_metadata.effectiveValue | false |
39+
40+
Given as user "admin"
41+
When sending "put" to ocs "/apps/libresign/api/v1/policies/user/signer1/collect_metadata"
42+
| value | true |
43+
Then the response should have a status code 200
44+
And the response should be a JSON array with the following mandatory values
45+
| key | value |
46+
| (jq).ocs.data.policy.policyKey | collect_metadata |
47+
| (jq).ocs.data.policy.scope | user_policy |
48+
| (jq).ocs.data.policy.targetId | signer1 |
49+
50+
Given as user "signer1"
51+
When sending "get" to ocs "/apps/libresign/api/v1/policies/effective"
52+
Then the response should have a status code 200
53+
And the response should be a JSON array with the following mandatory values
54+
| key | value |
55+
| (jq).ocs.data.policies.collect_metadata.effectiveValue | true |
56+
| (jq).ocs.data.policies.collect_metadata.sourceScope | user_policy |

0 commit comments

Comments
 (0)