You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
# I want to be able to register (users) with username and password
4
-
#
5
-
# Background:
6
-
# Given database is empty
7
-
# And user with id 1234 exists and has username "user", password "secure_password"
8
-
# And accessToken with value "accessToken" exists for user 1234
9
-
# And user with id 1234 is in group with id 1
10
-
#
11
-
# Scenario: Successful registration with username, password and password confirmation.
12
-
# When user requests registration with username "kangaroo", password "pig-system" and password confirmation "pig-system" with accessToken "accessToken"
13
-
# Then response status code is 201
14
-
# And response contains key "message" and value "User successfully created."
15
-
# And response contains key "status" and value "created"
16
-
#
17
-
# Scenario: Successful registration with username, password and password confirmation; password matches password of other users.
18
-
# When user requests registration with username "kangaroo", password "secure_password" and password confirmation "secure_password" with accessToken "accessToken"
19
-
# Then response status code is 201
20
-
# And response contains key "message" and value "User successfully created."
21
-
# And response contains key "status" and value "created"
22
-
#
23
-
# Scenario: Failed registration with used username, arbitrary password and password confirmation.
24
-
# When user requests registration with username "user", password "pig-system" and password confirmation "pig-system" with accessToken "accessToken"
25
-
# Then response status code is 409
26
-
# And response contains key "message" and value "User already exists."
27
-
# And response contains key "status" and value "conflict"
28
-
#
29
-
# Scenario: Failed registration with used username (other case), arbitrary password and password confirmation.
30
-
# When user requests registration with username "User", password "pig-system" and password confirmation "pig-system" with accessToken "accessToken"
31
-
# Then response status code is 409
32
-
# And response contains key "message" and value "User already exists."
33
-
# And response contains key "status" and value "conflict"
34
-
#
35
-
# Scenario: Failed registration with username, password and deviating password confirmation.
36
-
# When user requests registration with username "kangaroo", password "pig-system" and password confirmation "i-love-capitalism" with accessToken "accessToken"
37
-
# Then response status code is 409
38
-
# And response contains key "message" and value "Passwords do not match."
39
-
# And response contains key "status" and value "conflict"
40
-
#
41
-
# Scenario: Failed registration with username, password and password confirmation; username is part of password.
42
-
# When user requests registration with username "kangaroo", password "kangaroo-system" and password confirmation "kangaroo-system" with accessToken "accessToken"
43
-
# Then response status code is 409
44
-
# And response contains key "message" and value "Username must not appear in password."
45
-
# And response contains key "status" and value "conflict"
46
-
#
47
-
# Scenario: Failed registration with username, password and password confirmation; password appears in list of top 10k passwords
48
-
# When user requests registration with username "kangaroo", password "vietnam" and password confirmation "vietnam" with accessToken "accessToken"
49
-
# Then response status code is 409
50
-
# And response contains key "message" and value "Password must not appear in the top 10000 most common passwords."
51
-
# And response contains key "status" and value "conflict"
# Scenario: Failed registration with username, password and password confirmation; not in group ADMIN
55
-
# Given user with id 1236 exists
56
-
# And user with id 1236 is in group with id -1
57
-
# And accessToken with value "wrongAccessToken" exists for user 1236
58
-
# When user requests registration with username "kangaroo", password "pig-system" and password confirmation "pig-system" with accessToken "wrongAccessToken"
59
-
# Then response status code is 401
60
-
# And response contains key "message" and value "User must not register new users."
61
-
# And response contains key "status" and value "unauthorized"
1
+
Feature: User Registration
2
+
As a user (/admin)
3
+
I want to be able to register (users) with username and password
4
+
5
+
Background:
6
+
Given database is empty
7
+
And user with id 1234 exists and has username "user", password "secure_password"
8
+
And accessToken with value "accessToken" exists for user 1234
9
+
And user with id 1234 is in group with id 1
10
+
11
+
Scenario: Successful registration with username, password and password confirmation.
12
+
When user requests registration with username "kangaroo", password "pig-system" and password confirmation "pig-system" with accessToken "accessToken"
13
+
Then response status code is 201
14
+
And response contains key "message" and value "User successfully created."
15
+
And response contains key "status" and value "created"
16
+
17
+
Scenario: Successful registration with username, password and password confirmation; password matches password of other users.
18
+
When user requests registration with username "kangaroo", password "secure_password" and password confirmation "secure_password" with accessToken "accessToken"
19
+
Then response status code is 201
20
+
And response contains key "message" and value "User successfully created."
21
+
And response contains key "status" and value "created"
22
+
23
+
Scenario: Failed registration with used username, arbitrary password and password confirmation.
24
+
When user requests registration with username "user", password "pig-system" and password confirmation "pig-system" with accessToken "accessToken"
25
+
Then response status code is 409
26
+
And response contains key "message" and value "User already exists."
27
+
And response contains key "status" and value "conflict"
28
+
29
+
Scenario: Failed registration with used username (other case), arbitrary password and password confirmation.
30
+
When user requests registration with username "User", password "pig-system" and password confirmation "pig-system" with accessToken "accessToken"
31
+
Then response status code is 409
32
+
And response contains key "message" and value "User already exists."
33
+
And response contains key "status" and value "conflict"
34
+
35
+
Scenario: Failed registration with username, password and deviating password confirmation.
36
+
When user requests registration with username "kangaroo", password "pig-system" and password confirmation "i-love-capitalism" with accessToken "accessToken"
37
+
Then response status code is 409
38
+
And response contains key "message" and value "Passwords do not match."
39
+
And response contains key "status" and value "conflict"
40
+
41
+
Scenario: Failed registration with username, password and password confirmation; username is part of password.
42
+
When user requests registration with username "kangaroo", password "kangaroo-system" and password confirmation "kangaroo-system" with accessToken "accessToken"
43
+
Then response status code is 409
44
+
And response contains key "message" and value "Username must not appear in password."
45
+
And response contains key "status" and value "conflict"
46
+
47
+
Scenario: Failed registration with username, password and password confirmation; password appears in list of top 10k passwords
48
+
When user requests registration with username "kangaroo", password "vietnam" and password confirmation "vietnam" with accessToken "accessToken"
49
+
Then response status code is 409
50
+
And response contains key "message" and value "Password must not appear in the top 10000 most common passwords."
51
+
And response contains key "status" and value "conflict"
Scenario: Failed registration with username, password and password confirmation; not in group ADMIN
55
+
Given user 1236 exists
56
+
And user with id 1236 is in group with id -1
57
+
And accessToken with value "wrongAccessToken" exists for user 1236
58
+
When user requests registration with username "kangaroo", password "pig-system" and password confirmation "pig-system" with accessToken "wrongAccessToken"
59
+
Then response status code is 401
60
+
And response contains key "message" and value "User must not register new users."
61
+
And response contains key "status" and value "unauthorized"
0 commit comments