1 |
efrain |
1 |
@core @core_admin @core_user
|
|
|
2 |
Feature: Allowing multiple accounts to have the same email address
|
|
|
3 |
In order to manage user accounts
|
|
|
4 |
As an admin
|
|
|
5 |
I need to be able to set whether to allow multiple accounts with the same email or not
|
|
|
6 |
|
|
|
7 |
Scenario Outline: Create a user with the same email as an existing user
|
|
|
8 |
Given the following config values are set as admin:
|
|
|
9 |
| allowaccountssameemail | <allowsameemail> |
|
|
|
10 |
And the following "users" exist:
|
|
|
11 |
| username | firstname | lastname | email |
|
|
|
12 |
| s1 | John | Doe | s1@example.com |
|
|
|
13 |
When I log in as "admin"
|
|
|
14 |
And I navigate to "Users > Accounts > Add a new user" in site administration
|
|
|
15 |
And I set the following fields to these values:
|
|
|
16 |
| Username | s2 |
|
|
|
17 |
| First name | Jane |
|
|
|
18 |
| Last name | Doe |
|
|
|
19 |
| Email address | <email> |
|
|
|
20 |
| New password | test |
|
|
|
21 |
And I press "Create user"
|
|
|
22 |
Then I should <expect> "This email address is already registered."
|
|
|
23 |
|
|
|
24 |
Examples:
|
|
|
25 |
| allowsameemail | email | expect |
|
|
|
26 |
| 0 | s1@example.com | see |
|
|
|
27 |
| 0 | S1@EXAMPLE.COM | see |
|
|
|
28 |
| 1 | s1@example.com | not see |
|
|
|
29 |
| 1 | S1@EXAMPLE.COM | not see |
|
|
|
30 |
|
|
|
31 |
Scenario Outline: Update a user with the same email as an existing user
|
|
|
32 |
Given the following config values are set as admin:
|
|
|
33 |
| allowaccountssameemail | <allowsameemail> |
|
|
|
34 |
And the following "users" exist:
|
|
|
35 |
| username | firstname | lastname | email |
|
|
|
36 |
| s1 | John | Doe | s1@example.com |
|
|
|
37 |
| s2 | Jane | Doe | s2@example.com |
|
|
|
38 |
When I am on the "s2" "user > editing" page logged in as "admin"
|
|
|
39 |
And I set the field "Email address" to "<email>"
|
|
|
40 |
And I press "Update profile"
|
|
|
41 |
Then I should <expect> "This email address is already registered."
|
|
|
42 |
|
|
|
43 |
Examples:
|
|
|
44 |
| allowsameemail | email | expect |
|
|
|
45 |
| 0 | s1@example.com | see |
|
|
|
46 |
| 0 | S1@EXAMPLE.COM | see |
|
|
|
47 |
| 1 | s1@example.com | not see |
|
|
|
48 |
| 1 | S1@EXAMPLE.COM | not see |
|
|
|
49 |
| 0 | S2@EXAMPLE.COM | not see |
|
|
|
50 |
| 1 | S2@EXAMPLE.COM | not see |
|
|
|
51 |
|
|
|
52 |
Scenario Outline: Update own user profile with the same email as an existing user
|
|
|
53 |
Given the following config values are set as admin:
|
|
|
54 |
| allowaccountssameemail | <allowsameemail> |
|
|
|
55 |
And the following "users" exist:
|
|
|
56 |
| username | firstname | lastname | email |
|
|
|
57 |
| s1 | John | Doe | s1@example.com |
|
|
|
58 |
| s2 | Jane | Doe | s2@example.com |
|
|
|
59 |
When I log in as "s2"
|
|
|
60 |
And I open my profile in edit mode
|
|
|
61 |
And I set the field "Email address" to "<email>"
|
|
|
62 |
And I press "Update profile"
|
|
|
63 |
Then I should <expect> "This email address is already registered."
|
|
|
64 |
|
|
|
65 |
Examples:
|
|
|
66 |
| allowsameemail | email | expect |
|
|
|
67 |
| 0 | s1@example.com | see |
|
|
|
68 |
| 0 | S1@EXAMPLE.COM | see |
|
|
|
69 |
| 1 | s1@example.com | not see |
|
|
|
70 |
| 1 | S1@EXAMPLE.COM | not see |
|
|
|
71 |
| 0 | S2@EXAMPLE.COM | not see |
|
|
|
72 |
| 1 | S2@EXAMPLE.COM | not see |
|