-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegisterUser.feature
More file actions
60 lines (52 loc) · 2.85 KB
/
Copy pathRegisterUser.feature
File metadata and controls
60 lines (52 loc) · 2.85 KB
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
53
54
55
56
57
58
59
60
Feature: Register User
In order to use the app
As a user
I want to register myself and get an account
Scenario: Register succesfully
Given There is no registered user with username "user"
And I'm not logged in
When I register a new user with username "user", email "user@sample.app" and password "password"
Then The response code is 201
And It has been created a user with username "user" and email "user@sample.app", the password is not returned
And I can login with username "user" and password "password"
Scenario: Register existing username
Given There is a registered user with username "user" and password "existing" and email "user@sample.app"
And I'm not logged in
When I register a new user with username "user", email "user@sample.app" and password "newpassword"
Then The response code is 409
And I cannot login with username "user" and password "newpassword"
Scenario: Register user when already authenticated
Given I login as "demo" with password "password"
When I register a new user with username "user", email "user@sample.app" and password "password"
Then The response code is 403
And It has not been created a user with username "user"
Scenario: Register user with empty password
Given I'm not logged in
When I register a new user with username "user", email "user@sample.app" and password ""
Then The response code is 400
And The error message is "must not be blank"
And It has not been created a user with username "user"
Scenario: Register user with empty email
Given I'm not logged in
When I register a new user with username "user", email "" and password "password"
Then The response code is 400
And The error message is "must not be blank"
And It has not been created a user with username "user"
Scenario: Register user with invalid email
Given I'm not logged in
When I register a new user with username "user", email "userasample.app" and password "password"
Then The response code is 400
And The error message is "must be a well-formed email address"
And It has not been created a user with username "user"
Scenario: Register user with password shorter than 8 characters
Given I'm not logged in
When I register a new user with username "user", email "user@sample.app" and password "pass"
Then The response code is 400
And The error message is "length must be between 8 and 256"
And It has not been created a user with username "user"
Scenario: Register user with an existing email
Given There is a registered user with username "user" and password "password" and email "user@sample.app"
And I'm not logged in
When I register a new user with username "user2", email "user@sample.app" and password "password2"
Then The response code is 409
And I can login with username "user" and password "password"