forked from ezsystems/repository-forms
/
user_registration.feature
74 lines (67 loc) · 2.94 KB
/
user_registration.feature
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Feature: User registration form
In order to allow users to create an account on a site
As a site owner
I want to expose a user registration form
Scenario: Registration is disabled for users who do not have the "user/register" policy
Given I do not have the user/register policy
When I go to "/register"
Then I see an error message saying that I can not register
Scenario: A new user account can be registered from "/register"
Given I do have the user/register policy
And I go to "/register"
Then I can see the registration form
And it matches the structure of the configured registration user Content Type
And it has a register button
When I fill in the form with valid values
And I click on the register button
Then I am on the registration confirmation page
And I see a registration confirmation message
And the user account has been created
Scenario: The user group where registered users are created can be customized
Given a User Group
And the following user registration group configuration:
"""
ezpublish:
system:
default:
user_registration:
group_id: <userGroupContentId>
"""
When I register a user account
Then the user is created in this user group
Scenario: The user registration templates can be customized
Given I do have the user/register policy
And the following user registration templates configuration:
"""
ezpublish:
system:
default:
user_registration:
templates:
form: 'AppBundle:user:registration_form.html.twig'
confirmation: 'AppBundle:user:registration_confirmation.html.twig'
"""
And the following template in "src/AppBundle/Resources/views/user/registration_form.html.twig":
"""
{% extends noLayout is defined and noLayout == true ? viewbaseLayout : pagelayout %}
{% block content %}
{% import "EzSystemsRepositoryFormsBundle:Content:content_form.html.twig" as contentForms %}
<section class="ez-content-edit">
{{ contentForms.display_form(form) }}
</section>
{% endblock %}
"""
And the following template in "src/AppBundle/Resources/views/user/registration_confirmation.html.twig":
"""
{% extends noLayout is defined and noLayout == true ? viewbaseLayout : pagelayout %}
{% block content %}
<h1>Your account has been created</h1>
<p class="user-register-confirmation-message">
Thank you for registering an account. You can now <a href="{{ path('login') }}">login</a>.
</p>
{% endblock %}
"""
When I go to "/register"
Then the form is rendered using the "user/registration_form.html.twig" template
When I register a user account
Then the confirmation page is rendered using the "user/registration_confirmation.html.twig" template