locomotivecms_steam 1.2.1 → 1.3.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Gemfile +3 -2
- data/Gemfile.lock +57 -50
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/config/locales/nl.yml +2 -2
- data/lib/locomotive/steam/adapters/filesystem/yaml_loaders/content_entry.rb +8 -0
- data/lib/locomotive/steam/adapters/memory/condition.rb +1 -1
- data/lib/locomotive/steam/configuration.rb +1 -1
- data/lib/locomotive/steam/decorators/template_decorator.rb +1 -1
- data/lib/locomotive/steam/entities/content_entry.rb +17 -0
- data/lib/locomotive/steam/entities/content_type.rb +1 -0
- data/lib/locomotive/steam/entities/content_type_field.rb +1 -0
- data/lib/locomotive/steam/entities/editable_element.rb +4 -0
- data/lib/locomotive/steam/errors.rb +35 -5
- data/lib/locomotive/steam/initializers/sprockets.rb +6 -80
- data/lib/locomotive/steam/liquid/drops/page.rb +9 -2
- data/lib/locomotive/steam/liquid/filters/date.rb +109 -0
- data/lib/locomotive/steam/liquid/tags/action.rb +6 -1
- data/lib/locomotive/steam/liquid/tags/authorize.rb +65 -0
- data/lib/locomotive/steam/liquid/tags/snippet.rb +10 -2
- data/lib/locomotive/steam/liquid/template.rb +3 -1
- data/lib/locomotive/steam/middlewares/auth.rb +187 -0
- data/lib/locomotive/steam/middlewares/redirection.rb +24 -0
- data/lib/locomotive/steam/middlewares/renderer.rb +20 -3
- data/lib/locomotive/steam/middlewares/sitemap.rb +3 -1
- data/lib/locomotive/steam/middlewares/templatized_page.rb +1 -6
- data/lib/locomotive/steam/middlewares/thread_safe.rb +19 -0
- data/lib/locomotive/steam/middlewares/url_redirection.rb +14 -1
- data/lib/locomotive/steam/repositories.rb +5 -1
- data/lib/locomotive/steam/repositories/content_entry_repository.rb +1 -1
- data/lib/locomotive/steam/repositories/content_type_field_repository.rb +4 -0
- data/lib/locomotive/steam/server.rb +2 -0
- data/lib/locomotive/steam/services.rb +9 -1
- data/lib/locomotive/steam/services/action_service.rb +26 -7
- data/lib/locomotive/steam/services/asset_host_service.rb +6 -1
- data/lib/locomotive/steam/services/auth_service.rb +105 -0
- data/lib/locomotive/steam/services/content_entry_service.rb +14 -0
- data/lib/locomotive/steam/services/external_api_service.rb +59 -25
- data/lib/locomotive/steam/services/liquid_parser_service.rb +5 -1
- data/lib/locomotive/steam/services/page_redirection_service.rb +29 -0
- data/lib/locomotive/steam/version.rb +1 -1
- data/locomotivecms_steam.gemspec +18 -16
- data/spec/fixtures/default/app/content_types/accounts.yml +59 -0
- data/spec/fixtures/default/app/content_types/songs.yml +2 -1
- data/spec/fixtures/default/app/views/pages/about_us/john_doe.fr.liquid.haml +5 -1
- data/spec/fixtures/default/app/views/pages/about_us/john_doe.liquid.haml +1 -1
- data/spec/fixtures/default/app/views/pages/account/forgot_password.liquid +39 -0
- data/spec/fixtures/default/app/views/pages/account/me.liquid +15 -0
- data/spec/fixtures/default/app/views/pages/account/reset_password.liquid +42 -0
- data/spec/fixtures/default/app/views/pages/account/sign_in.liquid +49 -0
- data/spec/fixtures/default/app/views/pages/all.liquid.haml +1 -1
- data/spec/fixtures/default/app/views/pages/emails/reset_password.liquid +15 -0
- data/spec/fixtures/default/app/views/pages/songs/template.liquid.haml +1 -1
- data/spec/fixtures/default/config/metafields_schema.yml +10 -0
- data/spec/fixtures/default/config/site.yml +5 -0
- data/spec/fixtures/default/config/translations.yml +25 -1
- data/spec/fixtures/default/data/accounts.yml +15 -0
- data/spec/fixtures/mongodb/locomotive_accounts.bson +0 -0
- data/spec/fixtures/mongodb/locomotive_accounts.metadata.json +1 -1
- data/spec/fixtures/mongodb/locomotive_activities.bson +0 -0
- data/spec/fixtures/mongodb/locomotive_activities.metadata.json +1 -1
- data/spec/fixtures/mongodb/locomotive_content_assets.bson +0 -0
- data/spec/fixtures/mongodb/locomotive_content_assets.metadata.json +1 -1
- data/spec/fixtures/mongodb/locomotive_content_entries.bson +0 -0
- data/spec/fixtures/mongodb/locomotive_content_entries.metadata.json +1 -1
- data/spec/fixtures/mongodb/locomotive_content_types.bson +0 -0
- data/spec/fixtures/mongodb/locomotive_content_types.metadata.json +1 -1
- data/spec/fixtures/mongodb/locomotive_pages.bson +0 -0
- data/spec/fixtures/mongodb/locomotive_pages.metadata.json +1 -1
- data/spec/fixtures/mongodb/locomotive_sites.bson +0 -0
- data/spec/fixtures/mongodb/locomotive_sites.metadata.json +1 -1
- data/spec/fixtures/mongodb/locomotive_snippets.bson +0 -0
- data/spec/fixtures/mongodb/locomotive_snippets.metadata.json +1 -1
- data/spec/fixtures/mongodb/locomotive_theme_assets.bson +0 -0
- data/spec/fixtures/mongodb/locomotive_theme_assets.metadata.json +1 -1
- data/spec/fixtures/mongodb/locomotive_translations.bson +0 -0
- data/spec/fixtures/mongodb/locomotive_translations.metadata.json +1 -1
- data/spec/integration/repositories/content_entry_repository_spec.rb +1 -1
- data/spec/integration/repositories/content_type_repository_spec.rb +1 -1
- data/spec/integration/repositories/page_repository_spec.rb +3 -3
- data/spec/integration/repositories/theme_asset_repository_spec.rb +1 -1
- data/spec/integration/repositories/translation_repository_spec.rb +1 -1
- data/spec/integration/server/auth_spec.rb +196 -0
- data/spec/integration/server/basic_spec.rb +18 -0
- data/spec/integration/server/nav_spec.rb +1 -1
- data/spec/integration/server/sitemap_spec.rb +1 -1
- data/spec/integration/services/content_entry_service_spec.rb +1 -1
- data/spec/integration/services/external_api_service_spec.rb +9 -0
- data/spec/support/helpers.rb +1 -1
- data/spec/unit/adapters/filesystem/yaml_loaders/content_entry_spec.rb +17 -5
- data/spec/unit/adapters/filesystem/yaml_loaders/content_type_spec.rb +4 -4
- data/spec/unit/adapters/filesystem/yaml_loaders/page_spec.rb +7 -7
- data/spec/unit/adapters/filesystem/yaml_loaders/site_spec.rb +1 -1
- data/spec/unit/adapters/filesystem/yaml_loaders/translation_spec.rb +1 -1
- data/spec/unit/entities/content_entry_spec.rb +10 -0
- data/spec/unit/errors_spec.rb +2 -2
- data/spec/unit/initializers/sprockets_spec.rb +0 -14
- data/spec/unit/liquid/drops/page_spec.rb +3 -2
- data/spec/unit/liquid/filters/date_spec.rb +219 -0
- data/spec/unit/liquid/tags/action_spec.rb +9 -0
- data/spec/unit/liquid/tags/authorize_spec.rb +51 -0
- data/spec/unit/liquid/tags/link_to_spec.rb +1 -1
- data/spec/unit/liquid/tags/paginate_spec.rb +1 -1
- data/spec/unit/liquid/tags/snippet_spec.rb +10 -0
- data/spec/unit/middlewares/auth_spec.rb +31 -0
- data/spec/unit/middlewares/redirection_spec.rb +37 -0
- data/spec/unit/middlewares/url_redirection_spec.rb +20 -1
- data/spec/unit/services/action_service_spec.rb +57 -1
- data/spec/unit/services/asset_host_service_spec.rb +15 -0
- data/spec/unit/services/auth_service_spec.rb +156 -0
- data/spec/unit/services/external_api_service_spec.rb +22 -0
- data/spec/unit/services/page_redirection_service_spec.rb +49 -0
- metadata +96 -40
- data/CHANGELOG.md +0 -29
- data/spec/fixtures/mongodb/system.indexes.bson +0 -0
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
title: Reset password instructions
|
3
|
+
listed: false
|
4
|
+
published: true
|
5
|
+
handle: reset_password_instructions
|
6
|
+
---
|
7
|
+
Hello {{ account.name }},
|
8
|
+
|
9
|
+
To reset your password please follow the link below:
|
10
|
+
|
11
|
+
{{ reset_password_url }}
|
12
|
+
|
13
|
+
If you need help or have any questions, please visit https://www.locomotivecms.com
|
14
|
+
Thanks!
|
15
|
+
Locomotive
|
@@ -1,3 +1,27 @@
|
|
1
1
|
powered_by:
|
2
2
|
en: Powered by
|
3
|
-
fr: Propulsé par
|
3
|
+
fr: Propulsé par
|
4
|
+
|
5
|
+
auth_wrong_credentials:
|
6
|
+
en: Your email and/or password are incorrect
|
7
|
+
fr: Votre email et/ou mot de passe sont incorrects
|
8
|
+
|
9
|
+
auth_signed_out:
|
10
|
+
en: You've been signed out
|
11
|
+
fr: Vous avez été déconnecté(e)
|
12
|
+
|
13
|
+
auth_wrong_email:
|
14
|
+
en: Your email is unknown
|
15
|
+
fr: Votre email est inconnu
|
16
|
+
|
17
|
+
auth_reset_password_instructions_sent:
|
18
|
+
en: "The instructions for changing your password have been emailed to you"
|
19
|
+
fr: "Les instructions pour modifier votre mot de passe viennent de vous être envoyées"
|
20
|
+
|
21
|
+
auth_invalid_token:
|
22
|
+
en: "The reset token is not valid anymore"
|
23
|
+
fr: "Le token de re-initialisation du mot de passe n'est plus valide"
|
24
|
+
|
25
|
+
auth_password_too_short:
|
26
|
+
en: "Your password is too short"
|
27
|
+
fr: "Votre mot de passe est trop court"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
- "John":
|
2
|
+
email: 'john@doe.net'
|
3
|
+
password: 'easyone'
|
4
|
+
|
5
|
+
- "Jane":
|
6
|
+
email: 'john@doe.net'
|
7
|
+
password: 'anotherone'
|
8
|
+
_auth_reset_token: '420000000000000'
|
9
|
+
_auth_reset_sent_at: '2020-01-01T15:00:00.000Z'
|
10
|
+
|
11
|
+
- "Mickey":
|
12
|
+
email: 'mickey@doe.net'
|
13
|
+
password: 'anotherone'
|
14
|
+
_auth_reset_token: '420000000000001'
|
15
|
+
_auth_reset_sent_at: '2016-01-01T15:00:00.000Z'
|
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
{
|
1
|
+
{"options":{},"indexes":[{"v":1,"key":{"_id":1},"name":"_id_","ns":"locomotive_engine_dev.locomotive_accounts"}]}
|
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
{
|
1
|
+
{"options":{},"indexes":[{"v":1,"key":{"_id":1},"name":"_id_","ns":"locomotive_engine_dev.locomotive_activities"}]}
|
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
{
|
1
|
+
{"options":{},"indexes":[{"v":1,"key":{"_id":1},"name":"_id_","ns":"locomotive_engine_dev.locomotive_content_assets"}]}
|
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
{
|
1
|
+
{"options":{},"indexes":[{"v":1,"key":{"_id":1},"name":"_id_","ns":"locomotive_engine_dev.locomotive_content_entries"}]}
|
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
{
|
1
|
+
{"options":{},"indexes":[{"v":1,"key":{"_id":1},"name":"_id_","ns":"locomotive_engine_dev.locomotive_content_types"}]}
|
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
{
|
1
|
+
{"options":{},"indexes":[{"v":1,"key":{"_id":1},"name":"_id_","ns":"locomotive_engine_dev.locomotive_pages"}]}
|
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
{
|
1
|
+
{"options":{},"indexes":[{"v":1,"key":{"_id":1},"name":"_id_","ns":"locomotive_engine_dev.locomotive_sites"}]}
|
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
{
|
1
|
+
{"options":{},"indexes":[{"v":1,"key":{"_id":1},"name":"_id_","ns":"locomotive_engine_dev.locomotive_snippets"}]}
|
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
{
|
1
|
+
{"options":{},"indexes":[{"v":1,"key":{"_id":1},"name":"_id_","ns":"locomotive_engine_dev.locomotive_theme_assets"}]}
|
Binary file
|
@@ -1 +1 @@
|
|
1
|
-
{
|
1
|
+
{"options":{},"indexes":[{"v":1,"key":{"_id":1},"name":"_id_","ns":"locomotive_engine_dev.locomotive_translations"}]}
|
@@ -116,7 +116,7 @@ describe Locomotive::Steam::ContentEntryRepository do
|
|
116
116
|
|
117
117
|
let(:site_id) { mongodb_site_id }
|
118
118
|
let(:adapter) { Locomotive::Steam::MongoDBAdapter.new(database: 'steam_test', hosts: ['127.0.0.1:27017']) }
|
119
|
-
let(:entry_id) { BSON::ObjectId.from_string('
|
119
|
+
let(:entry_id) { BSON::ObjectId.from_string('5829ffa087f6435971756881') }
|
120
120
|
|
121
121
|
end
|
122
122
|
|
@@ -14,7 +14,7 @@ describe Locomotive::Steam::PageRepository do
|
|
14
14
|
describe '#all' do
|
15
15
|
let(:conditions) { {} }
|
16
16
|
subject { repository.all(conditions) }
|
17
|
-
it { expect(subject.size).to eq
|
17
|
+
it { expect(subject.size).to eq 33 }
|
18
18
|
|
19
19
|
context 'with conditions' do
|
20
20
|
let(:conditions) { { fullpath: 'index', 'slug.ne' => '404' } }
|
@@ -34,7 +34,7 @@ describe Locomotive::Steam::PageRepository do
|
|
34
34
|
|
35
35
|
describe '#only_handle_and_fullpath' do
|
36
36
|
subject { repository.only_handle_and_fullpath }
|
37
|
-
it { expect(subject.size).to eq
|
37
|
+
it { expect(subject.size).to eq 8 }
|
38
38
|
end
|
39
39
|
|
40
40
|
describe '#by_fullpath' do
|
@@ -78,7 +78,7 @@ describe Locomotive::Steam::PageRepository do
|
|
78
78
|
describe '#children_of' do
|
79
79
|
let(:page) { repository.root }
|
80
80
|
subject { repository.children_of(page) }
|
81
|
-
it { expect(subject.size).to eq
|
81
|
+
it { expect(subject.size).to eq 17 }
|
82
82
|
end
|
83
83
|
|
84
84
|
describe '#editable_element_for' do
|
@@ -26,7 +26,7 @@ describe Locomotive::Steam::ThemeAssetRepository do
|
|
26
26
|
describe '#checksums' do
|
27
27
|
subject { repository.checksums }
|
28
28
|
it { expect(subject.size).to eq 16 }
|
29
|
-
it { expect(subject['stylesheets/application.css']).to eq '
|
29
|
+
it { expect(subject['stylesheets/application.css']).to eq 'f431407c21db339b7759c2d7ded2553f' }
|
30
30
|
end
|
31
31
|
|
32
32
|
end
|
@@ -0,0 +1,196 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../integration_helper'
|
2
|
+
|
3
|
+
describe 'Authentication' do
|
4
|
+
|
5
|
+
include Rack::Test::Methods
|
6
|
+
|
7
|
+
def app
|
8
|
+
run_server
|
9
|
+
end
|
10
|
+
|
11
|
+
describe 'sign in action' do
|
12
|
+
|
13
|
+
it 'renders the form' do
|
14
|
+
get '/account/sign-in'
|
15
|
+
expect(last_response.body).to include '/account/sign-in'
|
16
|
+
expect(last_response.body).not_to include "You've been signed out"
|
17
|
+
end
|
18
|
+
|
19
|
+
describe 'press the sign in button' do
|
20
|
+
|
21
|
+
let(:params) { {
|
22
|
+
auth_action: 'sign_in',
|
23
|
+
auth_content_type: 'accounts',
|
24
|
+
auth_id_field: 'email',
|
25
|
+
auth_password_field: 'password',
|
26
|
+
auth_id: 'john@doe.net',
|
27
|
+
auth_password: 'easyone',
|
28
|
+
auth_callback: '/account/me'
|
29
|
+
} }
|
30
|
+
|
31
|
+
it 'redirects to the callback' do
|
32
|
+
sign_in(params)
|
33
|
+
expect(last_response.status).to eq 301
|
34
|
+
expect(last_response.location).to eq '/account/me'
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'displays the profile page as described in the params' do
|
38
|
+
sign_in(params, true)
|
39
|
+
expect(last_response.body).to include "My name is John and I'm logged in!"
|
40
|
+
end
|
41
|
+
|
42
|
+
context 'wrong credentials' do
|
43
|
+
|
44
|
+
let(:params) { {
|
45
|
+
auth_action: 'sign_in',
|
46
|
+
auth_content_type: 'accounts',
|
47
|
+
auth_id_field: 'email',
|
48
|
+
auth_password_field: 'password',
|
49
|
+
auth_id: 'john@doe.net',
|
50
|
+
auth_password: 'dontrememberit',
|
51
|
+
auth_callback: '/account/me'
|
52
|
+
} }
|
53
|
+
|
54
|
+
it 'renders the sign in page with an error message' do
|
55
|
+
sign_in(params)
|
56
|
+
expect(last_response.status).to eq 200
|
57
|
+
expect(last_response.body).to include '/account/sign-in'
|
58
|
+
expect(last_response.body).to include 'Your email and/or password are incorrect'
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
def sign_in(params, follow_redirect = false)
|
64
|
+
post '/account/sign-in', params
|
65
|
+
follow_redirect! if follow_redirect
|
66
|
+
last_response
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
describe 'sign out action' do
|
74
|
+
|
75
|
+
let(:params) { {
|
76
|
+
auth_action: 'sign_out',
|
77
|
+
auth_content_type: 'accounts'
|
78
|
+
} }
|
79
|
+
|
80
|
+
let(:rack_session) { {
|
81
|
+
'authenticated_entry_type' => 'accounts',
|
82
|
+
'authenticated_entry_id' => 'john'
|
83
|
+
} }
|
84
|
+
|
85
|
+
it 'displays the profile page as described in the params' do
|
86
|
+
post '/account/sign-in', params, { 'rack.session' => rack_session }
|
87
|
+
expect(last_response.body).to include "You've been signed out"
|
88
|
+
expect(last_response.body).not_to include "You're already authenticated!"
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
describe 'forgot password action' do
|
94
|
+
|
95
|
+
let(:email) { '' }
|
96
|
+
|
97
|
+
let(:params) { {
|
98
|
+
auth_action: 'forgot_password',
|
99
|
+
auth_content_type: 'accounts',
|
100
|
+
auth_id_field: 'email',
|
101
|
+
auth_id: email,
|
102
|
+
auth_reset_password_url: 'http://acme.com/account/reset-password',
|
103
|
+
auth_callback: '/account/sign-in',
|
104
|
+
auth_email_from: 'support@acme.com',
|
105
|
+
auth_email_handle: 'reset_password_instructions',
|
106
|
+
auth_email_smtp_address: 'smtp.nowhere.net',
|
107
|
+
auth_email_smtp_user_name: 'jane',
|
108
|
+
auth_email_smtp_password: 'easyone'
|
109
|
+
} }
|
110
|
+
|
111
|
+
it 'renders the forgot password page with an error message' do
|
112
|
+
post '/account/forgot-password', params
|
113
|
+
expect(last_response.status).to eq 200
|
114
|
+
expect(last_response.body).to include 'Forgot your password'
|
115
|
+
expect(last_response.body).to include 'Your email is unknown'
|
116
|
+
end
|
117
|
+
|
118
|
+
context 'with an known email' do
|
119
|
+
|
120
|
+
let(:email) { 'john@doe.net' }
|
121
|
+
|
122
|
+
it 'sends an email to the account' do
|
123
|
+
post '/account/forgot-password', params
|
124
|
+
expect(last_response.status).to eq 200
|
125
|
+
expect(last_response.body).to include "The instructions for changing your password have been emailed to you"
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
131
|
+
|
132
|
+
describe 'reset password action' do
|
133
|
+
|
134
|
+
let(:token) { '' }
|
135
|
+
let(:new_password) { 'newone!' }
|
136
|
+
|
137
|
+
let(:params) { {
|
138
|
+
auth_action: 'reset_password',
|
139
|
+
auth_content_type: 'accounts',
|
140
|
+
auth_password_field: 'password',
|
141
|
+
auth_password: new_password,
|
142
|
+
auth_reset_token: token,
|
143
|
+
auth_callback: '/account/me'
|
144
|
+
} }
|
145
|
+
|
146
|
+
it 'renders the reset password page with an error message' do
|
147
|
+
post '/account/reset-password', params
|
148
|
+
expect(last_response.status).to eq 200
|
149
|
+
expect(last_response.body).to include 'Change your password'
|
150
|
+
expect(last_response.body).to include 'The reset token is not valid anymore'
|
151
|
+
end
|
152
|
+
|
153
|
+
context 'with an expired token' do
|
154
|
+
|
155
|
+
let(:token) { '420000000000001' }
|
156
|
+
|
157
|
+
it 'renders the reset password page with an error message' do
|
158
|
+
post '/account/reset-password', params
|
159
|
+
expect(last_response.status).to eq 200
|
160
|
+
expect(last_response.body).to include 'Change your password'
|
161
|
+
expect(last_response.body).to include 'The reset token is not valid anymore'
|
162
|
+
end
|
163
|
+
|
164
|
+
end
|
165
|
+
|
166
|
+
context 'with a valid token' do
|
167
|
+
|
168
|
+
let(:token) { '420000000000000' }
|
169
|
+
|
170
|
+
it 'sends an email to the account' do
|
171
|
+
post '/account/reset-password', params
|
172
|
+
expect(last_response.status).to eq 301
|
173
|
+
follow_redirect!
|
174
|
+
expect(last_response.body).to include "My name is Jane and I'm logged in!"
|
175
|
+
end
|
176
|
+
|
177
|
+
context 'with a too short password' do
|
178
|
+
|
179
|
+
let(:new_password) { 'short' }
|
180
|
+
|
181
|
+
it 'renders the reset password page with an error message' do
|
182
|
+
post '/account/reset-password', params
|
183
|
+
expect(last_response.status).to eq 200
|
184
|
+
expect(last_response.body).to include 'Change your password'
|
185
|
+
expect(last_response.body).to include 'Your password is too short'
|
186
|
+
end
|
187
|
+
|
188
|
+
end
|
189
|
+
|
190
|
+
end
|
191
|
+
|
192
|
+
end
|
193
|
+
|
194
|
+
end
|
195
|
+
|
196
|
+
|
@@ -173,4 +173,22 @@ describe Locomotive::Steam::Server do
|
|
173
173
|
|
174
174
|
end
|
175
175
|
|
176
|
+
describe 'page with parse or render errors' do
|
177
|
+
|
178
|
+
context 'liquid parsing error' do
|
179
|
+
|
180
|
+
subject { get '/about-us/john-doe'; last_response.body }
|
181
|
+
it { expect { subject }.to raise_error(Locomotive::Steam::RenderError, "Liquid syntax error (line 1): Syntax Error in 'for loop' - Valid syntax: for [item] in [collection]") }
|
182
|
+
|
183
|
+
end
|
184
|
+
|
185
|
+
context 'rendering error' do
|
186
|
+
|
187
|
+
subject { get '/fr/a-notre-sujet/jean-personne'; last_response.body }
|
188
|
+
it { expect { subject }.to raise_error(Locomotive::Steam::ActionError, "identifier 'foo' undefined") }
|
189
|
+
|
190
|
+
end
|
191
|
+
|
192
|
+
end
|
193
|
+
|
176
194
|
end
|