Skip to content

Commit a0372e4

Browse files
authored
Merge pull request #5197 from LibreSign/chore/cover-scenario-of-two-accounts-with-same-email
chore: cover scenario of two accoutns with same email
2 parents 3b47eda + ebfeb1d commit a0372e4

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

tests/integration/features/sign/request.feature

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,62 @@ Feature: request-signature
2828
Scenario: Request to sign with error using different authenticated account
2929
Given as user "admin"
3030
And user "signer1" exists
31-
And run the command "libresign:configure:openssl --cn test" with result code 0
31+
And user "signer2" exists
3232
And set the email of user "signer1" to "signer1@domain.test"
33+
And set the email of user "signer2" to "signer2@domain.test"
34+
And my inbox is empty
3335
And reset notifications of user "signer1"
36+
And reset notifications of user "signer2"
37+
And run the command "libresign:configure:openssl --cn test" with result code 0
3438
And sending "post" to ocs "/apps/libresign/api/v1/request-signature"
3539
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} |
3640
| users | [{"identify":{"account":"signer1"}}] |
3741
| name | document |
3842
And the response should have a status code 200
43+
And there should be 1 emails in my inbox
44+
And I open the latest email to "signer1@domain.test" with subject "LibreSign: There is a file for you to sign"
3945
And as user "signer1"
4046
And I fetch the signer UUID from notification
47+
When sending "get" to "/apps/libresign/p/sign/<SIGN_UUID>"
48+
Then the response should have a status code 200
49+
And as user "signer2"
50+
When sending "get" to ocs "/apps/notifications/api/v2/notifications"
51+
Then the response should be a JSON array with the following mandatory values
52+
| key | value |
53+
| (jq).ocs.data | [] |
54+
When sending "get" to "/apps/libresign/p/sign/<SIGN_UUID>"
55+
Then the response should have a status code 422
56+
And the response should be a JSON array with the following mandatory values
57+
| key | value |
58+
| action | 2000 |
59+
| errors | [{"message":"Invalid user"}] |
60+
61+
Scenario: Request to sign with two accounts with same email
62+
Given as user "admin"
63+
And user "signer1" exists
4164
And user "signer2" exists
65+
And set the email of user "signer1" to "contact@domain.test"
66+
And set the email of user "signer2" to "contact@domain.test"
67+
And my inbox is empty
68+
And reset notifications of user "signer1"
69+
And reset notifications of user "signer2"
70+
And run the command "libresign:configure:openssl --cn test" with result code 0
71+
And sending "post" to ocs "/apps/libresign/api/v1/request-signature"
72+
| file | {"url":"<BASE_URL>/apps/libresign/develop/pdf"} |
73+
| users | [{"identify":{"account":"signer1"}}] |
74+
| name | document |
75+
And the response should have a status code 200
76+
And there should be 1 emails in my inbox
77+
And I open the latest email to "contact@domain.test" with subject "LibreSign: There is a file for you to sign"
78+
And as user "signer1"
79+
And I fetch the signer UUID from notification
80+
When sending "get" to "/apps/libresign/p/sign/<SIGN_UUID>"
81+
Then the response should have a status code 200
4282
And as user "signer2"
83+
When sending "get" to ocs "/apps/notifications/api/v2/notifications"
84+
Then the response should be a JSON array with the following mandatory values
85+
| key | value |
86+
| (jq).ocs.data | [] |
4387
When sending "get" to "/apps/libresign/p/sign/<SIGN_UUID>"
4488
Then the response should have a status code 422
4589
And the response should be a JSON array with the following mandatory values

0 commit comments

Comments
 (0)