locomotivecms 3.0.0.rc3 → 3.0.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -3
- data/README.md +1 -1
- data/app/assets/stylesheets/locomotive/unauthorized/_public.scss +7 -4
- data/app/controllers/locomotive/errors_controller.rb +4 -0
- data/app/helpers/locomotive/errors_helper.rb +2 -4
- data/app/models/locomotive/concerns/content_entry/csv.rb +4 -0
- data/app/models/locomotive/concerns/content_entry/slug.rb +0 -2
- data/app/models/locomotive/concerns/content_type/sync.rb +2 -2
- data/app/models/locomotive/concerns/page/templatized.rb +1 -1
- data/app/models/locomotive/concerns/site/access_points.rb +3 -3
- data/app/models/locomotive/theme_asset.rb +0 -1
- data/app/views/locomotive/developers_documentation/_wagon.html.slim +2 -2
- data/app/views/locomotive/devise_mailer/reset_password_instructions.html.slim +1 -0
- data/app/views/locomotive/errors/no_site.json +1 -0
- data/app/views/locomotive/shared/_sidebar.html.slim +1 -1
- data/app/views/locomotive/shared/_sidebar_without_site.html.slim +1 -1
- data/app/views/locomotive/shared/header/_account_menu.html.slim +2 -2
- data/config/locales/en.yml +1 -1
- data/config/routes.rb +4 -2
- data/lib/generators/locomotive/install/install_generator.rb +9 -9
- data/lib/generators/locomotive/install/templates/carrierwave.rb +23 -12
- data/lib/generators/locomotive/install/templates/carrierwave_aws.rb +36 -0
- data/lib/generators/locomotive/install/templates/mongoid.yml +97 -35
- data/lib/locomotive/dependencies.rb +1 -1
- data/lib/locomotive/middlewares/site.rb +10 -4
- data/lib/locomotive/mongoid/patches.rb +1 -1
- data/lib/locomotive/steam_adaptor.rb +6 -4
- data/lib/locomotive/version.rb +1 -1
- data/spec/dummy/config/application.rb +0 -3
- data/spec/dummy/config/initializers/devise.rb +128 -58
- data/spec/dummy/config/mongoid.yml +95 -78
- data/spec/models/locomotive/content_entry_spec.rb +6 -6
- data/spec/requests/locomotive/steam/cache_spec.rb +1 -1
- data/spec/requests/site_spec.rb +25 -0
- data/spec/support/mongoid.rb +2 -0
- metadata +16 -189
- data/features/api/accounts.feature +0 -43
- data/features/api/authentication.feature +0 -41
- data/features/api/authorization/accounts.feature +0 -165
- data/features/api/authorization/content_assets.feature +0 -147
- data/features/api/authorization/content_entries.feature +0 -202
- data/features/api/authorization/content_types.feature +0 -237
- data/features/api/authorization/current_site.feature +0 -30
- data/features/api/authorization/memberships.feature +0 -225
- data/features/api/authorization/pages.feature +0 -189
- data/features/api/authorization/sites.feature +0 -212
- data/features/api/authorization/snippets.feature +0 -179
- data/features/api/authorization/theme_assets.feature +0 -185
- data/features/api/authorization/translations.feature +0 -253
- data/features/api/content_entries.feature +0 -184
- data/features/api/content_types.feature +0 -156
- data/features/api/editable_elements.feature +0 -190
- data/features/api/entries_custom_fields.feature +0 -150
- data/features/api/memberships.feature +0 -26
- data/features/api/pages.feature +0 -72
- data/features/backoffice/authorization/account_settings.feature +0 -28
- data/features/backoffice/authorization/content_type.feature +0 -35
- data/features/backoffice/authorization/current_site.feature +0 -53
- data/features/backoffice/authorization/inline_front_end_editing.feature +0 -46
- data/features/backoffice/authorization/pages.feature +0 -95
- data/features/backoffice/authorization/theme_assets.feature +0 -50
- data/features/backoffice/content_types/edit.feature +0 -20
- data/features/backoffice/content_types/email.feature +0 -26
- data/features/backoffice/content_types/has_many.feature +0 -80
- data/features/backoffice/content_types/integer.feature +0 -26
- data/features/backoffice/content_types/localized.feature +0 -63
- data/features/backoffice/content_types/many_to_many.feature +0 -70
- data/features/backoffice/content_types/tags.feature +0 -22
- data/features/backoffice/content_types/uniqueness.feature +0 -29
- data/features/backoffice/contents.feature +0 -93
- data/features/backoffice/editable_elements.feature +0 -22
- data/features/backoffice/installation.feature +0 -33
- data/features/backoffice/login.feature +0 -33
- data/features/backoffice/mounting.feature +0 -13
- data/features/backoffice/my_account.feature +0 -22
- data/features/backoffice/pages.feature +0 -73
- data/features/backoffice/regressions.feature +0 -19
- data/features/backoffice/site.feature +0 -71
- data/features/backoffice/snippets.feature +0 -39
- data/features/backoffice/theme_assets.feature +0 -72
- data/features/backoffice/translations.feature +0 -50
- data/features/public/basic.feature +0 -30
- data/features/public/contact_form.feature +0 -98
- data/features/public/content_entries.feature +0 -69
- data/features/public/editable_elements.feature +0 -138
- data/features/public/has_many.feature +0 -8
- data/features/public/inheritance.feature +0 -157
- data/features/public/inline_front_end_editing.feature +0 -26
- data/features/public/many_to_many.feature +0 -64
- data/features/public/new_contact_form.feature +0 -95
- data/features/public/pages.feature +0 -116
- data/features/public/pagination.feature +0 -8
- data/features/public/robots.feature +0 -22
- data/features/public/session.feature +0 -40
- data/features/public/sitemap.feature +0 -74
- data/features/public/snippets.feature +0 -21
- data/features/public/tablerow.feature +0 -42
- data/features/public/tags.feature +0 -45
- data/features/step_definitions/api_steps.rb +0 -179
- data/features/step_definitions/backoffice/mounting_steps.rb +0 -22
- data/features/step_definitions/backoffice_steps.rb +0 -47
- data/features/step_definitions/content_assets_steps.rb +0 -12
- data/features/step_definitions/content_types_steps.rb +0 -135
- data/features/step_definitions/current_site_steps.rb +0 -43
- data/features/step_definitions/editable_elements_steps.rb +0 -24
- data/features/step_definitions/membership_steps.rb +0 -19
- data/features/step_definitions/more_web_steps.rb +0 -131
- data/features/step_definitions/page_steps.rb +0 -133
- data/features/step_definitions/pagination_steps.rb +0 -35
- data/features/step_definitions/pickle_steps.rb +0 -100
- data/features/step_definitions/relationships_steps.rb +0 -110
- data/features/step_definitions/site_steps.rb +0 -111
- data/features/step_definitions/snippet_steps.rb +0 -37
- data/features/step_definitions/theme_asset_steps.rb +0 -64
- data/features/step_definitions/translation_steps.rb +0 -7
- data/features/step_definitions/web_steps.rb +0 -225
- data/features/step_definitions/within_steps.rb +0 -14
- data/features/support/cleaner.rb +0 -4
- data/features/support/env.rb +0 -82
- data/features/support/factory_girl.rb +0 -2
- data/features/support/http.rb +0 -22
- data/features/support/locales.rb +0 -5
- data/features/support/paths.rb +0 -62
- data/features/support/pickle.rb +0 -24
- data/features/support/selectors.rb +0 -57
@@ -1,30 +0,0 @@
|
|
1
|
-
Feature: Engine
|
2
|
-
As a designer
|
3
|
-
I want to be able to build simple page html layouts
|
4
|
-
that render correctly to the client
|
5
|
-
|
6
|
-
Background:
|
7
|
-
Given I have the site: "test site" set up
|
8
|
-
|
9
|
-
Scenario: Simple Page
|
10
|
-
Given a page named "hello-world" with the template:
|
11
|
-
"""
|
12
|
-
Hello World
|
13
|
-
"""
|
14
|
-
When I view the rendered page at "/hello-world"
|
15
|
-
Then the rendered output should look like:
|
16
|
-
"""
|
17
|
-
Hello World
|
18
|
-
"""
|
19
|
-
|
20
|
-
Scenario: Missing 404 page
|
21
|
-
Given a page named "hello-world" with the template:
|
22
|
-
"""
|
23
|
-
Hello World
|
24
|
-
"""
|
25
|
-
And the page "404" is unpublished
|
26
|
-
When I view the rendered page at "/madeup"
|
27
|
-
Then the rendered output should look like:
|
28
|
-
"""
|
29
|
-
No Page!
|
30
|
-
"""
|
@@ -1,98 +0,0 @@
|
|
1
|
-
Feature: Contact form [Old way]
|
2
|
-
As a visitor
|
3
|
-
In order to keep in touch with the site
|
4
|
-
I want to be able to send them a message
|
5
|
-
|
6
|
-
Background:
|
7
|
-
Given I enable the CSRF protection for public submission requests
|
8
|
-
Given I have the site: "test site" set up
|
9
|
-
And I have a custom model named "Messages" with
|
10
|
-
| label | type | required |
|
11
|
-
| Email | string | true |
|
12
|
-
| Message | text | true |
|
13
|
-
| Category | select | true |
|
14
|
-
And I have "Design, Code, Business" as "Category" values of the "Messages" model
|
15
|
-
And I enable the public submission of the "Messages" model
|
16
|
-
And a page named "contact" with the template:
|
17
|
-
"""
|
18
|
-
<html>
|
19
|
-
<head></head>
|
20
|
-
<body>
|
21
|
-
<form action="{{ contents.messages.public_submission_url }}" method="post">
|
22
|
-
{% csrf_param %}
|
23
|
-
<input type="hidden" value="/success" name="success_callback" />
|
24
|
-
<input type="hidden" value="/contact" name="error_callback" />
|
25
|
-
<label for="email">E-Mail Address</label>
|
26
|
-
<input type="text" id="email" name="content[email]" />
|
27
|
-
{% if message.errors.email %}Email is required{% endif %}
|
28
|
-
<label for="category">Category</label>
|
29
|
-
<select id="category" name="content[category]">
|
30
|
-
<option value=""></option>
|
31
|
-
{% for name in contents.messages.category_options %}
|
32
|
-
<option value="{{ name }}">{{ name }}</option>
|
33
|
-
{% endfor %}
|
34
|
-
</select>
|
35
|
-
<label for="message">Message</label>
|
36
|
-
<textarea name="content[message]" id="message"></textarea>
|
37
|
-
<input name="submit" type="submit" id="submit" value="Submit" />
|
38
|
-
</form>
|
39
|
-
</body>
|
40
|
-
</html>
|
41
|
-
"""
|
42
|
-
And a page named "success" with the template:
|
43
|
-
"""
|
44
|
-
Thanks {{ message.email }}
|
45
|
-
"""
|
46
|
-
|
47
|
-
Scenario: Setting the right url for the contact form
|
48
|
-
When I view the rendered page at "/contact"
|
49
|
-
Then the rendered output should look like:
|
50
|
-
"""
|
51
|
-
<form action="/entry_submissions/messages" method="post">
|
52
|
-
"""
|
53
|
-
|
54
|
-
Scenario: Prevents users to post messages if the public submission option is disabled
|
55
|
-
Given I disable the public submission of the "Messages" model
|
56
|
-
When I view the rendered page at "/contact"
|
57
|
-
And I fill in "E-Mail Address" with "did@locomotivecms.com"
|
58
|
-
And I fill in "Message" with "LocomotiveCMS rocks"
|
59
|
-
And I press "Submit"
|
60
|
-
Then I should not see "Thanks did@locomotivecms.com"
|
61
|
-
|
62
|
-
Scenario: Sending a message with success
|
63
|
-
When I view the rendered page at "/contact"
|
64
|
-
And I fill in "E-Mail Address" with "did@locomotivecms.com"
|
65
|
-
And I fill in "Message" with "LocomotiveCMS rocks"
|
66
|
-
And I select "Code" from "Category"
|
67
|
-
And I press "Submit"
|
68
|
-
Then I should see "Thanks did@locomotivecms.com"
|
69
|
-
|
70
|
-
Scenario: Can not send a message if the csrf tag is missing
|
71
|
-
Given I delete the following code "{% csrf_param %}" from the "contact" page
|
72
|
-
When I view the rendered page at "/contact"
|
73
|
-
And I press "Submit"
|
74
|
-
Then I should see "Content of the home page"
|
75
|
-
|
76
|
-
Scenario: Can send a message if the csrf protection is disabled
|
77
|
-
Given I disable the CSRF protection for public submission requests
|
78
|
-
And I view the rendered page at "/contact"
|
79
|
-
And I fill in "E-Mail Address" with "did@locomotivecms.com"
|
80
|
-
And I fill in "Message" with "LocomotiveCMS rocks"
|
81
|
-
And I select "Code" from "Category"
|
82
|
-
And I press "Submit"
|
83
|
-
Then I should see "Thanks did@locomotivecms.com"
|
84
|
-
|
85
|
-
Scenario: Display errors
|
86
|
-
When I view the rendered page at "/contact"
|
87
|
-
And I fill in "Message" with "LocomotiveCMS rocks"
|
88
|
-
And I press "Submit"
|
89
|
-
Then I should see "Email is required"
|
90
|
-
|
91
|
-
Scenario: Make sure to use the right locale
|
92
|
-
When I view the rendered page at "/contact"
|
93
|
-
And the locale of the current ruby thread changes to "fr"
|
94
|
-
And I fill in "E-Mail Address" with "did@locomotivecms.com"
|
95
|
-
And I fill in "Message" with "LocomotiveCMS rocks"
|
96
|
-
And I select "Code" from "Category"
|
97
|
-
And I press "Submit"
|
98
|
-
Then I should see "Thanks did@locomotivecms.com"
|
@@ -1,69 +0,0 @@
|
|
1
|
-
Feature: Content entries
|
2
|
-
As a designer
|
3
|
-
I want to list and filter the entries of a
|
4
|
-
content type I designed through to the back-office and
|
5
|
-
I should be able to display the entries from a liquid template
|
6
|
-
|
7
|
-
Background:
|
8
|
-
Given I have the site: "test site" set up
|
9
|
-
And I have a custom model named "Articles" with
|
10
|
-
| label | type | required |
|
11
|
-
| Title | string | true |
|
12
|
-
| Body | string | false |
|
13
|
-
| Hidden | boolean | false |
|
14
|
-
| Published at | date | false |
|
15
|
-
And I have entries for "Articles" with
|
16
|
-
| title | body | published_at | hidden |
|
17
|
-
| Hello world | Lorem ipsum | 2015-01-01 | false |
|
18
|
-
| Lorem ipsum | Lorem ipsum... | 2013-03-23 | false |
|
19
|
-
| Yadi Yada | Lorem ipsum... | 2013-03-23 | true |
|
20
|
-
|
21
|
-
Scenario: List all of them
|
22
|
-
Given a page named "my-articles" with the template:
|
23
|
-
"""
|
24
|
-
{% for article in contents.articles %}{{ article.title }}, {% endfor %}
|
25
|
-
"""
|
26
|
-
When I view the rendered page at "/my-articles"
|
27
|
-
Then the rendered output should look like:
|
28
|
-
"""
|
29
|
-
Hello world, Lorem ipsum, Yadi Yada
|
30
|
-
"""
|
31
|
-
|
32
|
-
Scenario: Filter by a boolean
|
33
|
-
Given a page named "my-articles" with the template:
|
34
|
-
"""
|
35
|
-
{% with_scope hidden: false %}
|
36
|
-
{% for article in contents.articles %}{{ article.title }}, {% endfor %}
|
37
|
-
{% endwith_scope %}
|
38
|
-
"""
|
39
|
-
When I view the rendered page at "/my-articles"
|
40
|
-
Then the rendered output should look like:
|
41
|
-
"""
|
42
|
-
Hello world, Lorem ipsum
|
43
|
-
"""
|
44
|
-
|
45
|
-
Scenario: Filter by a date
|
46
|
-
Given a page named "my-articles" with the template:
|
47
|
-
"""
|
48
|
-
{% with_scope published_at.lte: now %}
|
49
|
-
{% for article in contents.articles %}{{ article.title }}, {% endfor %}
|
50
|
-
{% endwith_scope %}
|
51
|
-
"""
|
52
|
-
When I view the rendered page at "/my-articles"
|
53
|
-
Then the rendered output should look like:
|
54
|
-
"""
|
55
|
-
Lorem ipsum, Yadi Yada
|
56
|
-
"""
|
57
|
-
|
58
|
-
Scenario: Filter with regexp
|
59
|
-
Given a page named "my-articles" with the template:
|
60
|
-
"""
|
61
|
-
{% with_scope title: /ello|adi/ %}
|
62
|
-
{% for article in contents.articles %}{{ article.title }}, {% endfor %}
|
63
|
-
{% endwith_scope %}
|
64
|
-
"""
|
65
|
-
When I view the rendered page at "/my-articles"
|
66
|
-
Then the rendered output should look like:
|
67
|
-
"""
|
68
|
-
Hello world, Yadi Yada
|
69
|
-
"""
|
@@ -1,138 +0,0 @@
|
|
1
|
-
Feature: Editable elements
|
2
|
-
As a designer
|
3
|
-
I want to define content which will be edited by the website editor
|
4
|
-
|
5
|
-
Background:
|
6
|
-
Given I have the site: "test site" set up
|
7
|
-
|
8
|
-
Scenario: Simple short text element
|
9
|
-
Given a page named "hello-world" with the template:
|
10
|
-
"""
|
11
|
-
My application says {% editable_short_text 'a_sentence', hint: 'please enter a new sentence' %}Hello world{% endeditable_short_text %}
|
12
|
-
"""
|
13
|
-
When I view the rendered page at "/hello-world"
|
14
|
-
Then the rendered output should look like:
|
15
|
-
"""
|
16
|
-
My application says Hello world
|
17
|
-
"""
|
18
|
-
|
19
|
-
Scenario: Updating a page
|
20
|
-
Given a page named "hello-world" with the template:
|
21
|
-
"""
|
22
|
-
My application says {% editable_short_text 'a_sentence' %}Hello world{% endeditable_short_text %}
|
23
|
-
{% block main %}Main{% endblock %}
|
24
|
-
"""
|
25
|
-
When I update the "hello-world" page with the template:
|
26
|
-
"""
|
27
|
-
My application says {% editable_short_text 'a_sentence' %}Hello world{% endeditable_short_text %}
|
28
|
-
{% block main %}Main{% endblock %}
|
29
|
-
{% block sidebar %}{% editable_short_text 'title' %}Default sidebar title{% endeditable_short_text %}{% endblock %}
|
30
|
-
"""
|
31
|
-
And I view the rendered page at "/hello-world"
|
32
|
-
Then the rendered output should look like:
|
33
|
-
"""
|
34
|
-
My application says Hello world
|
35
|
-
Main
|
36
|
-
Default sidebar title
|
37
|
-
"""
|
38
|
-
|
39
|
-
Scenario: Modified short text element
|
40
|
-
Given a page named "hello-world" with the template:
|
41
|
-
"""
|
42
|
-
My application says {% editable_short_text 'a_sentence', hint: 'please enter a new sentence' %}Hello world{% endeditable_short_text %}
|
43
|
-
"""
|
44
|
-
And the editable element "a_sentence" in the "hello-world" page with the content "Bonjour"
|
45
|
-
When I view the rendered page at "/hello-world"
|
46
|
-
Then the rendered output should look like:
|
47
|
-
"""
|
48
|
-
My application says Bonjour
|
49
|
-
"""
|
50
|
-
|
51
|
-
Scenario: Short text element inside a block
|
52
|
-
Given a page named "hello-world" with the template:
|
53
|
-
"""
|
54
|
-
{% block main %}My application says {% editable_short_text 'a_sentence' %}Hello world{% endeditable_short_text %}{% endblock %}
|
55
|
-
"""
|
56
|
-
When I view the rendered page at "/hello-world"
|
57
|
-
Then the rendered output should look like:
|
58
|
-
"""
|
59
|
-
My application says Hello world
|
60
|
-
"""
|
61
|
-
|
62
|
-
Scenario: Not modified short text element inside a block and with page inheritance
|
63
|
-
Given a page named "hello-world" with the template:
|
64
|
-
"""
|
65
|
-
{% block main %}My application says {% editable_short_text 'a_sentence' %}Hello world{% endeditable_short_text %}{% endblock %}
|
66
|
-
"""
|
67
|
-
Given a page named "another-hello-world" with the template:
|
68
|
-
"""
|
69
|
-
{% extends hello-world %}
|
70
|
-
"""
|
71
|
-
When I view the rendered page at "/another-hello-world"
|
72
|
-
Then the rendered output should look like:
|
73
|
-
"""
|
74
|
-
My application says Hello world
|
75
|
-
"""
|
76
|
-
|
77
|
-
Scenario: Modified short text element inside a block and with page inheritance
|
78
|
-
Given a page named "hello-world" with the template:
|
79
|
-
"""
|
80
|
-
{% block main %}My application says {% editable_short_text 'a_sentence' %}Hello world{% endeditable_short_text %}{% endblock %}
|
81
|
-
"""
|
82
|
-
Given a page named "another-hello-world" with the template:
|
83
|
-
"""
|
84
|
-
{% extends hello-world %}
|
85
|
-
"""
|
86
|
-
And the editable element "a_sentence" for the "main" block in the "another-hello-world" page with the content "Bonjour"
|
87
|
-
When I view the rendered page at "/another-hello-world"
|
88
|
-
Then the rendered output should look like:
|
89
|
-
"""
|
90
|
-
My application says Bonjour
|
91
|
-
"""
|
92
|
-
|
93
|
-
Scenario: Combine inheritance and update
|
94
|
-
Given a page named "hello-world" with the template:
|
95
|
-
"""
|
96
|
-
My application says {% editable_short_text 'a_sentence' %}Hello world{% endeditable_short_text %}
|
97
|
-
{% block main %}Main{% endblock %}
|
98
|
-
"""
|
99
|
-
Given a page named "another-hello-world" with the template:
|
100
|
-
"""
|
101
|
-
{% extends hello-world %}
|
102
|
-
{% block main %}Another Main{% endblock %}
|
103
|
-
"""
|
104
|
-
When I update the "hello-world" page with the template:
|
105
|
-
"""
|
106
|
-
My application says {% editable_short_text 'a_sentence' %}Hello world{% endeditable_short_text %}
|
107
|
-
{% block main %}Main{% endblock %}
|
108
|
-
{% block sidebar %}{% editable_short_text 'title' %}Default sidebar title{% endeditable_short_text %}{% endblock %}
|
109
|
-
"""
|
110
|
-
And I view the rendered page at "/another-hello-world"
|
111
|
-
Then the rendered output should look like:
|
112
|
-
"""
|
113
|
-
My application says Hello world
|
114
|
-
Another Main
|
115
|
-
Default sidebar title
|
116
|
-
"""
|
117
|
-
|
118
|
-
Scenario: Insert editable files
|
119
|
-
Given a page named "hello-world" with the template:
|
120
|
-
"""
|
121
|
-
My application file is {% editable_file 'a_file', hint: 'please enter a new file' %}/default.pdf{% endeditable_file %}
|
122
|
-
"""
|
123
|
-
When I view the rendered page at "/hello-world"
|
124
|
-
Then the rendered output should look like:
|
125
|
-
"""
|
126
|
-
My application file is /default.pdf
|
127
|
-
"""
|
128
|
-
|
129
|
-
Scenario: Simple select element
|
130
|
-
Given a page named "hello-world" with the template:
|
131
|
-
"""
|
132
|
-
{% block menuecontent %}{% editable_control 'menueposition', options: 'top=Top of the Page,bottom=Bottom of the Page' %}bottom{% endeditable_control %}{% endblock %}
|
133
|
-
"""
|
134
|
-
When I view the rendered page at "/hello-world"
|
135
|
-
Then the rendered output should look like:
|
136
|
-
"""
|
137
|
-
bottom
|
138
|
-
"""
|
@@ -1,8 +0,0 @@
|
|
1
|
-
Feature: Has Many Association
|
2
|
-
As a designer
|
3
|
-
In order to make dealing with models easier
|
4
|
-
I want to be able to display other models that have a has many association
|
5
|
-
|
6
|
-
Scenario: Paginating a has many association
|
7
|
-
Given I have a site set up
|
8
|
-
Then I should be able to view a paginated list of a has many association
|
@@ -1,157 +0,0 @@
|
|
1
|
-
Feature: Inheritance
|
2
|
-
As a designer
|
3
|
-
I want to be able to build more complex page html layouts
|
4
|
-
with shared template code
|
5
|
-
that render correctly to the client
|
6
|
-
|
7
|
-
Background:
|
8
|
-
Given I have the site: "test site" set up
|
9
|
-
|
10
|
-
Scenario: Liquid Inheritance with a single block
|
11
|
-
Given a page named "above-and-below" with the template:
|
12
|
-
"""
|
13
|
-
<div class="header"></div>
|
14
|
-
<div class="body">
|
15
|
-
{% block body %}{% endblock %}
|
16
|
-
</div>
|
17
|
-
<div class="footer"></div>
|
18
|
-
"""
|
19
|
-
And a page named "hello-world-with-layout" with the template:
|
20
|
-
"""
|
21
|
-
{% extends 'above-and-below' %}
|
22
|
-
{% block body %}Hello World{% endblock %}
|
23
|
-
"""
|
24
|
-
When I view the rendered page at "/hello-world-with-layout"
|
25
|
-
Then the rendered output should look like:
|
26
|
-
"""
|
27
|
-
<div class="header"></div>
|
28
|
-
<div class="body">
|
29
|
-
Hello World
|
30
|
-
</div>
|
31
|
-
<div class="footer"></div>
|
32
|
-
"""
|
33
|
-
|
34
|
-
Scenario: Update a parent page and see modifications in descendants
|
35
|
-
Given a page named "base" with the template:
|
36
|
-
"""
|
37
|
-
My application say: {% block something %}Lorem ipsum{% endblock %}
|
38
|
-
"""
|
39
|
-
And a page named "hello-world" with the template:
|
40
|
-
"""
|
41
|
-
{% extends 'base' %}
|
42
|
-
{% block something %}Hello World{% endblock %}
|
43
|
-
"""
|
44
|
-
When I update the "base" page with the template:
|
45
|
-
"""
|
46
|
-
My application says: {% block something %}Lorem ipsum{% endblock %}
|
47
|
-
"""
|
48
|
-
When I view the rendered page at "/hello-world"
|
49
|
-
Then the rendered output should look like:
|
50
|
-
"""
|
51
|
-
My application says: Hello World
|
52
|
-
"""
|
53
|
-
|
54
|
-
Scenario: Liquid Inheritance with multiple blocks
|
55
|
-
Given a page named "layout-with-sidebar" with the template:
|
56
|
-
"""
|
57
|
-
<div class="header"></div>
|
58
|
-
<div class="content">
|
59
|
-
<div class="sidebar">
|
60
|
-
{% block sidebar %}DEFAULT SIDEBAR CONTENT{% endblock %}
|
61
|
-
</div>
|
62
|
-
<div class="body">
|
63
|
-
{% block body %}DEFAULT BODY CONTENT{% endblock %}
|
64
|
-
</div>
|
65
|
-
</div>
|
66
|
-
<div class="footer"></div>
|
67
|
-
"""
|
68
|
-
And a page named "hello-world-multiblocks" with the template:
|
69
|
-
"""
|
70
|
-
{% extends 'layout-with-sidebar' %}
|
71
|
-
{% block body %}Hello world{% endblock %}
|
72
|
-
"""
|
73
|
-
When I view the rendered page at "/hello-world-multiblocks"
|
74
|
-
Then the rendered output should look like:
|
75
|
-
"""
|
76
|
-
<div class="header"></div>
|
77
|
-
<div class="content">
|
78
|
-
<div class="sidebar">
|
79
|
-
DEFAULT SIDEBAR CONTENT
|
80
|
-
</div>
|
81
|
-
<div class="body">
|
82
|
-
Hello world
|
83
|
-
</div>
|
84
|
-
</div>
|
85
|
-
<div class="footer"></div>
|
86
|
-
"""
|
87
|
-
|
88
|
-
Scenario: Multiple inheritance (layout extending another layout)
|
89
|
-
Given a page named "layout-with-sidebar" with the template:
|
90
|
-
"""
|
91
|
-
<div class="header"></div>
|
92
|
-
<div class="content">
|
93
|
-
<div class="sidebar">{% block sidebar %}DEFAULT SIDEBAR CONTENT{% endblock %}</div>
|
94
|
-
<div class="body">
|
95
|
-
{% block body %}DEFAULT BODY CONTENT{% endblock %}
|
96
|
-
</div>
|
97
|
-
</div>
|
98
|
-
<div class="footer"></div>
|
99
|
-
"""
|
100
|
-
And a page named "custom-layout-with-sidebar" with the template:
|
101
|
-
"""
|
102
|
-
{% extends 'layout-with-sidebar' %}
|
103
|
-
{% block sidebar %}Custom sidebar{% endblock %}
|
104
|
-
{% block body %}Hello{% endblock %}
|
105
|
-
"""
|
106
|
-
And a page named "hello-world-multiblocks" with the template:
|
107
|
-
"""
|
108
|
-
{% extends 'custom-layout-with-sidebar' %}
|
109
|
-
{% block body %}{{ block.super }} world{% endblock %}
|
110
|
-
"""
|
111
|
-
When I view the rendered page at "/hello-world-multiblocks"
|
112
|
-
Then the rendered output should look like:
|
113
|
-
"""
|
114
|
-
<div class="header"></div>
|
115
|
-
<div class="content">
|
116
|
-
<div class="sidebar">Custom sidebar</div>
|
117
|
-
<div class="body">
|
118
|
-
Hello world
|
119
|
-
</div>
|
120
|
-
</div>
|
121
|
-
<div class="footer"></div>
|
122
|
-
"""
|
123
|
-
|
124
|
-
Scenario: Page extending a layout with multiple embedded blocks which extends another template
|
125
|
-
Given a page named "layout-with-sidebar" with the template:
|
126
|
-
"""
|
127
|
-
<div class="header"></div>
|
128
|
-
<div class="content">
|
129
|
-
<div class="sidebar">{% block sidebar %}DEFAULT SIDEBAR CONTENT{% endblock %}</div>
|
130
|
-
<div class="body">
|
131
|
-
{% block body %}Hello{% endblock %}
|
132
|
-
</div>
|
133
|
-
</div>
|
134
|
-
<div class="footer"></div>
|
135
|
-
"""
|
136
|
-
And a page named "custom-layout-with-sidebar" with the template:
|
137
|
-
"""
|
138
|
-
{% extends 'layout-with-sidebar' %}
|
139
|
-
{% block body %}{{ block.super }} {% block main %}mister{% endblock %}{% endblock %}
|
140
|
-
"""
|
141
|
-
And a page named "hello-world-multiblocks" with the template:
|
142
|
-
"""
|
143
|
-
{% extends 'custom-layout-with-sidebar' %}
|
144
|
-
{% block body/main %}{{ block.super }} Jacques{% endblock %}
|
145
|
-
"""
|
146
|
-
When I view the rendered page at "/hello-world-multiblocks"
|
147
|
-
Then the rendered output should look like:
|
148
|
-
"""
|
149
|
-
<div class="header"></div>
|
150
|
-
<div class="content">
|
151
|
-
<div class="sidebar">DEFAULT SIDEBAR CONTENT</div>
|
152
|
-
<div class="body">
|
153
|
-
Hello mister Jacques
|
154
|
-
</div>
|
155
|
-
</div>
|
156
|
-
<div class="footer"></div>
|
157
|
-
"""
|
@@ -1,26 +0,0 @@
|
|
1
|
-
@wip
|
2
|
-
@javascript
|
3
|
-
Feature: Engine
|
4
|
-
As an author
|
5
|
-
In order to easily be able to modify the contents of my website
|
6
|
-
I want to be able to edit the sites content on the front end
|
7
|
-
|
8
|
-
Background:
|
9
|
-
Given I have the site: "test site" set up
|
10
|
-
And I am an authenticated "author"
|
11
|
-
|
12
|
-
Scenario: Editing a short text field
|
13
|
-
Given a page named "about" with the template:
|
14
|
-
"""
|
15
|
-
<html>
|
16
|
-
<head>{% inline_editor %}</head>
|
17
|
-
<body>{% editable_short_text 'owner' %}Tom{% endeditable_short_text %} owns this website</body>
|
18
|
-
</html>
|
19
|
-
"""
|
20
|
-
When I view the rendered page at "/about"
|
21
|
-
Then I should see "edit"
|
22
|
-
When I follow "edit"
|
23
|
-
And I type the content "Mario" into the first editable field
|
24
|
-
And I follow "save"
|
25
|
-
And I view the rendered page at "/about"
|
26
|
-
Then I should see "Mario owns this website"
|
@@ -1,64 +0,0 @@
|
|
1
|
-
Feature: Many to Many Association
|
2
|
-
As a designer
|
3
|
-
In order to make dealing with models easier
|
4
|
-
I want to be able to display other models that have a many to many association
|
5
|
-
|
6
|
-
Background:
|
7
|
-
Given I have the site: "test site" set up
|
8
|
-
And I have a custom model named "Articles" with
|
9
|
-
| label | type | required |
|
10
|
-
| Title | string | true |
|
11
|
-
| Body | string | false |
|
12
|
-
And I have a custom model named "Projects" with
|
13
|
-
| label | type | required | target |
|
14
|
-
| Name | string | true | |
|
15
|
-
| Description | text | false | |
|
16
|
-
And I set up a many_to_many relationship between "Articles" and "Projects"
|
17
|
-
And I have entries for "Articles" with
|
18
|
-
| title | body |
|
19
|
-
| Hello world | Lorem ipsum |
|
20
|
-
| Lorem ipsum | Lorem ipsum... |
|
21
|
-
And I have entries for "Projects" with
|
22
|
-
| name | description |
|
23
|
-
| My sexy project | Lorem ipsum |
|
24
|
-
| Foo project | Lorem ipsum... |
|
25
|
-
| Bar project | Lorem ipsum... |
|
26
|
-
| Baz project | Lorem ipsum... |
|
27
|
-
And I attach the "My sexy project" project to the "Hello world" article
|
28
|
-
And I attach the "Baz project" project to the "Hello world" article
|
29
|
-
And I attach the "Foo project" project to the "Hello world" article
|
30
|
-
|
31
|
-
Scenario: Displaying the entries of a many to many association
|
32
|
-
Given a page named "article-projects" with the template:
|
33
|
-
"""
|
34
|
-
{% assign article = contents.articles.first %}
|
35
|
-
<h1>Projects for {{ article.title }}</h1>
|
36
|
-
<ul>
|
37
|
-
{% for project in article.projects %}<li>{{ project.name }}</li>
|
38
|
-
{% endfor %}
|
39
|
-
</ul>
|
40
|
-
"""
|
41
|
-
When I view the rendered page at "/article-projects"
|
42
|
-
Then the rendered output should look like:
|
43
|
-
"""
|
44
|
-
|
45
|
-
<h1>Projects for Hello world</h1>
|
46
|
-
<ul>
|
47
|
-
<li>My sexy project</li>
|
48
|
-
<li>Baz project</li>
|
49
|
-
<li>Foo project</li>
|
50
|
-
|
51
|
-
</ul>
|
52
|
-
"""
|
53
|
-
|
54
|
-
Scenario: Displaying the entries of a many to many association by a different thread
|
55
|
-
Given the "Projects" model was created by another thread
|
56
|
-
And a page named "article-projects" with the template:
|
57
|
-
"""
|
58
|
-
{% assign article = contents.articles.first %}{% for project in article.projects %}{{ project.name }}, {% endfor %}
|
59
|
-
"""
|
60
|
-
When I view the rendered page at "/article-projects"
|
61
|
-
Then the rendered output should look like:
|
62
|
-
"""
|
63
|
-
My sexy project, Baz project, Foo project
|
64
|
-
"""
|