high_voltage 2.2.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -4
- data/.travis.yml +15 -5
- data/Appraisals +7 -10
- data/CONTRIBUTING.md +4 -1
- data/Gemfile +4 -1
- data/Gemfile.lock +65 -43
- data/MIT-LICENSE +1 -1
- data/NEWS.md +18 -0
- data/README.md +86 -18
- data/Rakefile +9 -4
- data/app/controllers/concerns/high_voltage/static_page.rb +8 -11
- data/gemfiles/rails4.0.gemfile +9 -0
- data/gemfiles/rails4.1.gemfile +9 -0
- data/gemfiles/rails4.2.gemfile +9 -0
- data/gemfiles/rails50.gemfile +10 -0
- data/high_voltage.gemspec +0 -2
- data/lib/high_voltage/configuration.rb +4 -22
- data/lib/high_voltage/constraints/root_route.rb +17 -10
- data/lib/high_voltage/engine.rb +10 -3
- data/lib/high_voltage/page.rb +44 -0
- data/lib/high_voltage/page_collector.rb +23 -0
- data/lib/high_voltage/page_finder.rb +16 -2
- data/lib/high_voltage/version.rb +1 -1
- data/lib/high_voltage.rb +2 -0
- data/spec/constraints/root_route_spec.rb +23 -8
- data/spec/controllers/pages_controller_spec.rb +57 -52
- data/spec/fake_app.rb +15 -0
- data/spec/fixtures/app/views/pages/_partial.html.erb +1 -0
- data/spec/fixtures/app/views/pages/text.txt.erb +1 -0
- data/spec/fixtures/config/database.yml +3 -0
- data/spec/high_voltage/configuration_spec.rb +0 -57
- data/spec/high_voltage/page_collector_spec.rb +36 -0
- data/spec/high_voltage/page_finder_spec.rb +34 -14
- data/spec/high_voltage/page_spec.rb +65 -0
- data/spec/spec_helper.rb +21 -8
- data/spec/support/http_method_shim.rb +15 -0
- metadata +57 -127
- data/spec/controllers/action_caching_controller_spec.rb +0 -38
- data/spec/controllers/page_caching_controller_spec.rb +0 -37
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/config/application.rb +0 -43
- data/spec/dummy/config/boot.rb +0 -10
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -25
- data/spec/dummy/config/environments/production.rb +0 -49
- data/spec/dummy/config/environments/test.rb +0 -30
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -10
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_key_base.rb +0 -1
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -26
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/application.js +0 -2
- data/spec/dummy/public/javascripts/controls.js +0 -965
- data/spec/dummy/public/javascripts/dragdrop.js +0 -974
- data/spec/dummy/public/javascripts/effects.js +0 -1123
- data/spec/dummy/public/javascripts/prototype.js +0 -6001
- data/spec/dummy/public/javascripts/rails.js +0 -191
- data/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/spec/dummy/script/rails +0 -6
- /data/spec/{dummy → fixtures}/app/views/layouts/alternate.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/layouts/application.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/other/wrong.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/other_pages/also_dir/also_nested.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/other_pages/also_exists.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/other_pages/also_exists_but_references_nonexistent_partial.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/also_dir/also_nested.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/also_exists.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/also_exists_but_references_nonexistent_partial.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/dir/nested.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/exists.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/exists_but_references_nonexistent_partial.html.erb +0 -0
- /data/spec/{dummy → fixtures}/app/views/pages/rot13.html.erb +0 -0
- /data/spec/{dummy → fixtures}/config/routes.rb +0 -0
- /data/spec/{dummy → fixtures}/public/pages/exists.html +0 -0
- /data/spec/{dummy → support}/app/controllers/alternative_finder_controller.rb +0 -0
- /data/spec/{dummy → support}/app/controllers/subclassed_pages_controller.rb +0 -0
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: high_voltage
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Jankowski
|
|
@@ -16,7 +16,7 @@ authors:
|
|
|
16
16
|
autorequire:
|
|
17
17
|
bindir: bin
|
|
18
18
|
cert_chain: []
|
|
19
|
-
date:
|
|
19
|
+
date: 2016-04-15 00:00:00.000000000 Z
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
22
22
|
name: activesupport
|
|
@@ -32,20 +32,6 @@ dependencies:
|
|
|
32
32
|
- - ">="
|
|
33
33
|
- !ruby/object:Gem::Version
|
|
34
34
|
version: 3.1.0
|
|
35
|
-
- !ruby/object:Gem::Dependency
|
|
36
|
-
name: appraisal
|
|
37
|
-
requirement: !ruby/object:Gem::Requirement
|
|
38
|
-
requirements:
|
|
39
|
-
- - ">="
|
|
40
|
-
- !ruby/object:Gem::Version
|
|
41
|
-
version: '0'
|
|
42
|
-
type: :development
|
|
43
|
-
prerelease: false
|
|
44
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
45
|
-
requirements:
|
|
46
|
-
- - ">="
|
|
47
|
-
- !ruby/object:Gem::Version
|
|
48
|
-
version: '0'
|
|
49
35
|
- !ruby/object:Gem::Dependency
|
|
50
36
|
name: pry
|
|
51
37
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -60,20 +46,6 @@ dependencies:
|
|
|
60
46
|
- - ">="
|
|
61
47
|
- !ruby/object:Gem::Version
|
|
62
48
|
version: '0'
|
|
63
|
-
- !ruby/object:Gem::Dependency
|
|
64
|
-
name: rspec-rails
|
|
65
|
-
requirement: !ruby/object:Gem::Requirement
|
|
66
|
-
requirements:
|
|
67
|
-
- - ">="
|
|
68
|
-
- !ruby/object:Gem::Version
|
|
69
|
-
version: '0'
|
|
70
|
-
type: :development
|
|
71
|
-
prerelease: false
|
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
-
requirements:
|
|
74
|
-
- - ">="
|
|
75
|
-
- !ruby/object:Gem::Version
|
|
76
|
-
version: '0'
|
|
77
49
|
description: Fire in the disco. Fire in the ... taco bell.
|
|
78
50
|
email:
|
|
79
51
|
- support@thoughtbot.com
|
|
@@ -94,75 +66,57 @@ files:
|
|
|
94
66
|
- app/controllers/concerns/high_voltage/static_page.rb
|
|
95
67
|
- app/controllers/high_voltage/pages_controller.rb
|
|
96
68
|
- config/routes.rb
|
|
69
|
+
- gemfiles/rails4.0.gemfile
|
|
70
|
+
- gemfiles/rails4.1.gemfile
|
|
71
|
+
- gemfiles/rails4.2.gemfile
|
|
72
|
+
- gemfiles/rails50.gemfile
|
|
97
73
|
- high_voltage.gemspec
|
|
98
74
|
- lib/high_voltage.rb
|
|
99
75
|
- lib/high_voltage/configuration.rb
|
|
100
76
|
- lib/high_voltage/constraints/root_route.rb
|
|
101
77
|
- lib/high_voltage/engine.rb
|
|
78
|
+
- lib/high_voltage/page.rb
|
|
79
|
+
- lib/high_voltage/page_collector.rb
|
|
102
80
|
- lib/high_voltage/page_finder.rb
|
|
103
81
|
- lib/high_voltage/route_drawers/default.rb
|
|
104
82
|
- lib/high_voltage/route_drawers/root.rb
|
|
105
83
|
- lib/high_voltage/version.rb
|
|
106
84
|
- spec/constraints/root_route_spec.rb
|
|
107
|
-
- spec/controllers/action_caching_controller_spec.rb
|
|
108
85
|
- spec/controllers/alternative_finder_controller_spec.rb
|
|
109
|
-
- spec/controllers/page_caching_controller_spec.rb
|
|
110
86
|
- spec/controllers/pages_controller_spec.rb
|
|
111
87
|
- spec/controllers/subclassed_pages_controller_spec.rb
|
|
112
|
-
- spec/
|
|
113
|
-
- spec/
|
|
114
|
-
- spec/
|
|
115
|
-
- spec/
|
|
116
|
-
- spec/
|
|
117
|
-
- spec/
|
|
118
|
-
- spec/
|
|
119
|
-
- spec/
|
|
120
|
-
- spec/
|
|
121
|
-
- spec/
|
|
122
|
-
- spec/
|
|
123
|
-
- spec/
|
|
124
|
-
- spec/
|
|
125
|
-
- spec/
|
|
126
|
-
- spec/
|
|
127
|
-
- spec/
|
|
128
|
-
- spec/
|
|
129
|
-
- spec/
|
|
130
|
-
- spec/
|
|
131
|
-
- spec/dummy/config/application.rb
|
|
132
|
-
- spec/dummy/config/boot.rb
|
|
133
|
-
- spec/dummy/config/environment.rb
|
|
134
|
-
- spec/dummy/config/environments/development.rb
|
|
135
|
-
- spec/dummy/config/environments/production.rb
|
|
136
|
-
- spec/dummy/config/environments/test.rb
|
|
137
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
|
138
|
-
- spec/dummy/config/initializers/inflections.rb
|
|
139
|
-
- spec/dummy/config/initializers/mime_types.rb
|
|
140
|
-
- spec/dummy/config/initializers/secret_key_base.rb
|
|
141
|
-
- spec/dummy/config/initializers/secret_token.rb
|
|
142
|
-
- spec/dummy/config/initializers/session_store.rb
|
|
143
|
-
- spec/dummy/config/locales/en.yml
|
|
144
|
-
- spec/dummy/config/routes.rb
|
|
145
|
-
- spec/dummy/public/404.html
|
|
146
|
-
- spec/dummy/public/422.html
|
|
147
|
-
- spec/dummy/public/500.html
|
|
148
|
-
- spec/dummy/public/favicon.ico
|
|
149
|
-
- spec/dummy/public/javascripts/application.js
|
|
150
|
-
- spec/dummy/public/javascripts/controls.js
|
|
151
|
-
- spec/dummy/public/javascripts/dragdrop.js
|
|
152
|
-
- spec/dummy/public/javascripts/effects.js
|
|
153
|
-
- spec/dummy/public/javascripts/prototype.js
|
|
154
|
-
- spec/dummy/public/javascripts/rails.js
|
|
155
|
-
- spec/dummy/public/pages/exists.html
|
|
156
|
-
- spec/dummy/public/stylesheets/.gitkeep
|
|
157
|
-
- spec/dummy/script/rails
|
|
88
|
+
- spec/fake_app.rb
|
|
89
|
+
- spec/fixtures/app/views/layouts/alternate.html.erb
|
|
90
|
+
- spec/fixtures/app/views/layouts/application.html.erb
|
|
91
|
+
- spec/fixtures/app/views/other/wrong.html.erb
|
|
92
|
+
- spec/fixtures/app/views/other_pages/also_dir/also_nested.html.erb
|
|
93
|
+
- spec/fixtures/app/views/other_pages/also_exists.html.erb
|
|
94
|
+
- spec/fixtures/app/views/other_pages/also_exists_but_references_nonexistent_partial.html.erb
|
|
95
|
+
- spec/fixtures/app/views/pages/_partial.html.erb
|
|
96
|
+
- spec/fixtures/app/views/pages/also_dir/also_nested.html.erb
|
|
97
|
+
- spec/fixtures/app/views/pages/also_exists.html.erb
|
|
98
|
+
- spec/fixtures/app/views/pages/also_exists_but_references_nonexistent_partial.html.erb
|
|
99
|
+
- spec/fixtures/app/views/pages/dir/nested.html.erb
|
|
100
|
+
- spec/fixtures/app/views/pages/exists.html.erb
|
|
101
|
+
- spec/fixtures/app/views/pages/exists_but_references_nonexistent_partial.html.erb
|
|
102
|
+
- spec/fixtures/app/views/pages/rot13.html.erb
|
|
103
|
+
- spec/fixtures/app/views/pages/text.txt.erb
|
|
104
|
+
- spec/fixtures/config/database.yml
|
|
105
|
+
- spec/fixtures/config/routes.rb
|
|
106
|
+
- spec/fixtures/public/pages/exists.html
|
|
158
107
|
- spec/high_voltage/configuration_spec.rb
|
|
108
|
+
- spec/high_voltage/page_collector_spec.rb
|
|
159
109
|
- spec/high_voltage/page_finder_spec.rb
|
|
110
|
+
- spec/high_voltage/page_spec.rb
|
|
160
111
|
- spec/high_voltage_spec.rb
|
|
161
112
|
- spec/integration/navigation_spec.rb
|
|
162
113
|
- spec/minimal_spec_helper.rb
|
|
163
114
|
- spec/requests/home_page_spec.rb
|
|
164
115
|
- spec/routing/routes_spec.rb
|
|
165
116
|
- spec/spec_helper.rb
|
|
117
|
+
- spec/support/app/controllers/alternative_finder_controller.rb
|
|
118
|
+
- spec/support/app/controllers/subclassed_pages_controller.rb
|
|
119
|
+
- spec/support/http_method_shim.rb
|
|
166
120
|
homepage: http://github.com/thoughtbot/high_voltage
|
|
167
121
|
licenses:
|
|
168
122
|
- MIT
|
|
@@ -183,68 +137,44 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
183
137
|
version: '0'
|
|
184
138
|
requirements: []
|
|
185
139
|
rubyforge_project:
|
|
186
|
-
rubygems_version: 2.
|
|
140
|
+
rubygems_version: 2.5.1
|
|
187
141
|
signing_key:
|
|
188
142
|
specification_version: 4
|
|
189
143
|
summary: Simple static page rendering controller
|
|
190
144
|
test_files:
|
|
191
145
|
- spec/constraints/root_route_spec.rb
|
|
192
|
-
- spec/controllers/action_caching_controller_spec.rb
|
|
193
146
|
- spec/controllers/alternative_finder_controller_spec.rb
|
|
194
|
-
- spec/controllers/page_caching_controller_spec.rb
|
|
195
147
|
- spec/controllers/pages_controller_spec.rb
|
|
196
148
|
- spec/controllers/subclassed_pages_controller_spec.rb
|
|
197
|
-
- spec/
|
|
198
|
-
- spec/
|
|
199
|
-
- spec/
|
|
200
|
-
- spec/
|
|
201
|
-
- spec/
|
|
202
|
-
- spec/
|
|
203
|
-
- spec/
|
|
204
|
-
- spec/
|
|
205
|
-
- spec/
|
|
206
|
-
- spec/
|
|
207
|
-
- spec/
|
|
208
|
-
- spec/
|
|
209
|
-
- spec/
|
|
210
|
-
- spec/
|
|
211
|
-
- spec/
|
|
212
|
-
- spec/
|
|
213
|
-
- spec/
|
|
214
|
-
- spec/
|
|
215
|
-
- spec/
|
|
216
|
-
- spec/dummy/config/application.rb
|
|
217
|
-
- spec/dummy/config/boot.rb
|
|
218
|
-
- spec/dummy/config/environment.rb
|
|
219
|
-
- spec/dummy/config/environments/development.rb
|
|
220
|
-
- spec/dummy/config/environments/production.rb
|
|
221
|
-
- spec/dummy/config/environments/test.rb
|
|
222
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
|
223
|
-
- spec/dummy/config/initializers/inflections.rb
|
|
224
|
-
- spec/dummy/config/initializers/mime_types.rb
|
|
225
|
-
- spec/dummy/config/initializers/secret_key_base.rb
|
|
226
|
-
- spec/dummy/config/initializers/secret_token.rb
|
|
227
|
-
- spec/dummy/config/initializers/session_store.rb
|
|
228
|
-
- spec/dummy/config/locales/en.yml
|
|
229
|
-
- spec/dummy/config/routes.rb
|
|
230
|
-
- spec/dummy/public/404.html
|
|
231
|
-
- spec/dummy/public/422.html
|
|
232
|
-
- spec/dummy/public/500.html
|
|
233
|
-
- spec/dummy/public/favicon.ico
|
|
234
|
-
- spec/dummy/public/javascripts/application.js
|
|
235
|
-
- spec/dummy/public/javascripts/controls.js
|
|
236
|
-
- spec/dummy/public/javascripts/dragdrop.js
|
|
237
|
-
- spec/dummy/public/javascripts/effects.js
|
|
238
|
-
- spec/dummy/public/javascripts/prototype.js
|
|
239
|
-
- spec/dummy/public/javascripts/rails.js
|
|
240
|
-
- spec/dummy/public/pages/exists.html
|
|
241
|
-
- spec/dummy/public/stylesheets/.gitkeep
|
|
242
|
-
- spec/dummy/script/rails
|
|
149
|
+
- spec/fake_app.rb
|
|
150
|
+
- spec/fixtures/app/views/layouts/alternate.html.erb
|
|
151
|
+
- spec/fixtures/app/views/layouts/application.html.erb
|
|
152
|
+
- spec/fixtures/app/views/other/wrong.html.erb
|
|
153
|
+
- spec/fixtures/app/views/other_pages/also_dir/also_nested.html.erb
|
|
154
|
+
- spec/fixtures/app/views/other_pages/also_exists.html.erb
|
|
155
|
+
- spec/fixtures/app/views/other_pages/also_exists_but_references_nonexistent_partial.html.erb
|
|
156
|
+
- spec/fixtures/app/views/pages/_partial.html.erb
|
|
157
|
+
- spec/fixtures/app/views/pages/also_dir/also_nested.html.erb
|
|
158
|
+
- spec/fixtures/app/views/pages/also_exists.html.erb
|
|
159
|
+
- spec/fixtures/app/views/pages/also_exists_but_references_nonexistent_partial.html.erb
|
|
160
|
+
- spec/fixtures/app/views/pages/dir/nested.html.erb
|
|
161
|
+
- spec/fixtures/app/views/pages/exists.html.erb
|
|
162
|
+
- spec/fixtures/app/views/pages/exists_but_references_nonexistent_partial.html.erb
|
|
163
|
+
- spec/fixtures/app/views/pages/rot13.html.erb
|
|
164
|
+
- spec/fixtures/app/views/pages/text.txt.erb
|
|
165
|
+
- spec/fixtures/config/database.yml
|
|
166
|
+
- spec/fixtures/config/routes.rb
|
|
167
|
+
- spec/fixtures/public/pages/exists.html
|
|
243
168
|
- spec/high_voltage/configuration_spec.rb
|
|
169
|
+
- spec/high_voltage/page_collector_spec.rb
|
|
244
170
|
- spec/high_voltage/page_finder_spec.rb
|
|
171
|
+
- spec/high_voltage/page_spec.rb
|
|
245
172
|
- spec/high_voltage_spec.rb
|
|
246
173
|
- spec/integration/navigation_spec.rb
|
|
247
174
|
- spec/minimal_spec_helper.rb
|
|
248
175
|
- spec/requests/home_page_spec.rb
|
|
249
176
|
- spec/routing/routes_spec.rb
|
|
250
177
|
- spec/spec_helper.rb
|
|
178
|
+
- spec/support/app/controllers/alternative_finder_controller.rb
|
|
179
|
+
- spec/support/app/controllers/subclassed_pages_controller.rb
|
|
180
|
+
- spec/support/http_method_shim.rb
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe HighVoltage::PagesController, '#action_caching' do
|
|
4
|
-
let(:page_name) { :exists }
|
|
5
|
-
|
|
6
|
-
context 'action_caching set to true' do
|
|
7
|
-
after do
|
|
8
|
-
set_action_caching_without_deprecation(false)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it 'caches the action' do
|
|
12
|
-
allow(controller).to receive(:_save_fragment)
|
|
13
|
-
set_action_caching_without_deprecation(true)
|
|
14
|
-
|
|
15
|
-
get :show, id: page_name
|
|
16
|
-
|
|
17
|
-
expect(controller).to have_received(:_save_fragment)
|
|
18
|
-
.with("test.host#{page_path(page_name)}", {})
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
context 'action_caching set to false' do
|
|
23
|
-
it 'does not cache the action' do
|
|
24
|
-
allow(controller).to receive(:_save_fragment)
|
|
25
|
-
set_action_caching_without_deprecation(false)
|
|
26
|
-
|
|
27
|
-
get :show, id: page_name
|
|
28
|
-
|
|
29
|
-
expect(controller).not_to have_received(:_save_fragment)
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def set_action_caching_without_deprecation(value)
|
|
34
|
-
ActiveSupport::Deprecation.silence do
|
|
35
|
-
HighVoltage.action_caching = value
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe HighVoltage::PagesController, '#cache_page' do
|
|
4
|
-
let(:page_name) { :exists }
|
|
5
|
-
|
|
6
|
-
context 'page_caching set to true' do
|
|
7
|
-
after do
|
|
8
|
-
set_page_caching_without_deprecation(false)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it 'caches the page' do
|
|
12
|
-
allow(controller).to receive(:cache_page)
|
|
13
|
-
set_page_caching_without_deprecation(true)
|
|
14
|
-
|
|
15
|
-
get :show, id: page_name
|
|
16
|
-
|
|
17
|
-
expect(controller).to have_received(:cache_page)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
context 'page_caching set to false' do
|
|
22
|
-
it 'does not cache the page' do
|
|
23
|
-
allow(controller).to receive(:cache_page)
|
|
24
|
-
set_page_caching_without_deprecation(false)
|
|
25
|
-
|
|
26
|
-
get :show, id: page_name
|
|
27
|
-
|
|
28
|
-
expect(controller).not_to have_received(:cache_page)
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def set_page_caching_without_deprecation(value)
|
|
33
|
-
ActiveSupport::Deprecation.silence do
|
|
34
|
-
HighVoltage.page_caching = value
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
data/spec/dummy/Rakefile
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
|
2
|
-
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
|
3
|
-
|
|
4
|
-
require File.expand_path('../config/application', __FILE__)
|
|
5
|
-
require 'rake'
|
|
6
|
-
|
|
7
|
-
Dummy::Application.load_tasks
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
require File.expand_path('../boot', __FILE__)
|
|
2
|
-
|
|
3
|
-
require "active_model/railtie"
|
|
4
|
-
require "action_controller/railtie"
|
|
5
|
-
require "action_view/railtie"
|
|
6
|
-
|
|
7
|
-
Bundler.require
|
|
8
|
-
require "high_voltage"
|
|
9
|
-
|
|
10
|
-
module Dummy
|
|
11
|
-
class Application < Rails::Application
|
|
12
|
-
# Settings in config/environments/* take precedence over those specified here.
|
|
13
|
-
# Application configuration should go into files in config/initializers
|
|
14
|
-
# -- all .rb files in that directory are automatically loaded.
|
|
15
|
-
|
|
16
|
-
# Custom directories with classes and modules you want to be autoloadable.
|
|
17
|
-
# config.autoload_paths += %W(#{config.root}/extras)
|
|
18
|
-
|
|
19
|
-
# Only load the plugins named here, in the order given (default is alphabetical).
|
|
20
|
-
# :all can be used as a placeholder for all plugins not explicitly named.
|
|
21
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
|
22
|
-
|
|
23
|
-
# Activate observers that should always be running.
|
|
24
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
|
25
|
-
|
|
26
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
|
27
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
|
28
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
|
29
|
-
|
|
30
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
|
31
|
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
|
32
|
-
# config.i18n.default_locale = :de
|
|
33
|
-
|
|
34
|
-
# JavaScript files you want as :defaults (application.js is always included).
|
|
35
|
-
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
|
36
|
-
|
|
37
|
-
# Configure the default encoding used in templates for Ruby 1.9.
|
|
38
|
-
config.encoding = "utf-8"
|
|
39
|
-
|
|
40
|
-
# Configure sensitive parameters which will be filtered from the log file.
|
|
41
|
-
config.filter_parameters += [:password]
|
|
42
|
-
end
|
|
43
|
-
end
|
data/spec/dummy/config/boot.rb
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
Dummy::Application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
3
|
-
|
|
4
|
-
# In the development environment your application's code is reloaded on
|
|
5
|
-
# every request. This slows down response time but is perfect for development
|
|
6
|
-
# since you don't have to restart the webserver when you make code changes.
|
|
7
|
-
config.cache_classes = false
|
|
8
|
-
|
|
9
|
-
# Log error messages when you accidentally call methods on nil.
|
|
10
|
-
config.whiny_nils = true
|
|
11
|
-
|
|
12
|
-
# Show full error reports and disable caching
|
|
13
|
-
config.consider_all_requests_local = true
|
|
14
|
-
config.action_controller.perform_caching = false
|
|
15
|
-
|
|
16
|
-
# Don't care if the mailer can't send
|
|
17
|
-
config.action_mailer.raise_delivery_errors = false
|
|
18
|
-
|
|
19
|
-
# Print deprecation notices to the Rails logger
|
|
20
|
-
config.active_support.deprecation = :log
|
|
21
|
-
|
|
22
|
-
# Only use best-standards-support built into browsers
|
|
23
|
-
config.action_dispatch.best_standards_support = :builtin
|
|
24
|
-
end
|
|
25
|
-
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
Dummy::Application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
3
|
-
|
|
4
|
-
# The production environment is meant for finished, "live" apps.
|
|
5
|
-
# Code is not reloaded between requests
|
|
6
|
-
config.cache_classes = true
|
|
7
|
-
|
|
8
|
-
# Full error reports are disabled and caching is turned on
|
|
9
|
-
config.consider_all_requests_local = false
|
|
10
|
-
config.action_controller.perform_caching = true
|
|
11
|
-
|
|
12
|
-
# Specifies the header that your server uses for sending files
|
|
13
|
-
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
|
14
|
-
|
|
15
|
-
# For nginx:
|
|
16
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
|
17
|
-
|
|
18
|
-
# If you have no front-end server that supports something like X-Sendfile,
|
|
19
|
-
# just comment this out and Rails will serve the files
|
|
20
|
-
|
|
21
|
-
# See everything in the log (default is :info)
|
|
22
|
-
# config.log_level = :debug
|
|
23
|
-
|
|
24
|
-
# Use a different logger for distributed setups
|
|
25
|
-
# config.logger = SyslogLogger.new
|
|
26
|
-
|
|
27
|
-
# Use a different cache store in production
|
|
28
|
-
# config.cache_store = :mem_cache_store
|
|
29
|
-
|
|
30
|
-
# Disable Rails's static asset server
|
|
31
|
-
# In production, Apache or nginx will already do this
|
|
32
|
-
config.serve_static_assets = false
|
|
33
|
-
|
|
34
|
-
# Enable serving of images, stylesheets, and javascripts from an asset server
|
|
35
|
-
# config.action_controller.asset_host = "http://assets.example.com"
|
|
36
|
-
|
|
37
|
-
# Disable delivery errors, bad email addresses will be ignored
|
|
38
|
-
# config.action_mailer.raise_delivery_errors = false
|
|
39
|
-
|
|
40
|
-
# Enable threaded mode
|
|
41
|
-
# config.threadsafe!
|
|
42
|
-
|
|
43
|
-
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
|
44
|
-
# the I18n.default_locale when a translation can not be found)
|
|
45
|
-
config.i18n.fallbacks = true
|
|
46
|
-
|
|
47
|
-
# Send deprecation notices to registered listeners
|
|
48
|
-
config.active_support.deprecation = :notify
|
|
49
|
-
end
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
Dummy::Application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
3
|
-
|
|
4
|
-
# The test environment is used exclusively to run your application's
|
|
5
|
-
# test suite. You never need to work with it otherwise. Remember that
|
|
6
|
-
# your test database is "scratch space" for the test suite and is wiped
|
|
7
|
-
# and recreated between test runs. Don't rely on the data there!
|
|
8
|
-
config.cache_classes = true
|
|
9
|
-
|
|
10
|
-
config.eager_load = false
|
|
11
|
-
|
|
12
|
-
# Show full error reports and disable caching
|
|
13
|
-
config.consider_all_requests_local = true
|
|
14
|
-
config.action_controller.perform_caching = true
|
|
15
|
-
config.action_controller.cache_store = :memory_store
|
|
16
|
-
|
|
17
|
-
# Raise exceptions instead of rendering exception templates
|
|
18
|
-
config.action_dispatch.show_exceptions = false
|
|
19
|
-
|
|
20
|
-
# Disable request forgery protection in test environment
|
|
21
|
-
config.action_controller.allow_forgery_protection = false
|
|
22
|
-
|
|
23
|
-
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
|
24
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
|
25
|
-
# like if you have constraints or database-specific column types
|
|
26
|
-
# config.active_record.schema_format = :sql
|
|
27
|
-
|
|
28
|
-
# Print deprecation notices to the stderr
|
|
29
|
-
config.active_support.deprecation = :stderr
|
|
30
|
-
end
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
|
4
|
-
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
|
5
|
-
|
|
6
|
-
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
|
7
|
-
# Rails.backtrace_cleaner.remove_silencers!
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
# Add new inflection rules using the following format
|
|
4
|
-
# (all these examples are active by default):
|
|
5
|
-
# ActiveSupport::Inflector.inflections do |inflect|
|
|
6
|
-
# inflect.plural /^(ox)$/i, '\1en'
|
|
7
|
-
# inflect.singular /^(ox)en/i, '\1'
|
|
8
|
-
# inflect.irregular 'person', 'people'
|
|
9
|
-
# inflect.uncountable %w( fish sheep )
|
|
10
|
-
# end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Dummy::Application.config.secret_key_base = '9c0b876ab8f513cc23d354b6d684c88eb9bc5f73ddc8d5843e7c6ac9176c5819adc2620e220980a3cb818de687753f1bfc56c66c4454b74fc7d432813f8e555a'
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
# Your secret key for verifying the integrity of signed cookies.
|
|
4
|
-
# If you change this key, all old signed cookies will become invalid!
|
|
5
|
-
# Make sure the secret is at least 30 characters and all random,
|
|
6
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
|
7
|
-
Dummy::Application.config.secret_token = 'b8d5d5687c012c2ef1a7a6e8006172402c48a3dcccca67c076eaad81c4712ad236ca2717c3706df7b286468c749d223f22acb0d96c27bdf33bbdbb9684ad46e5'
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
|
2
|
-
|
|
3
|
-
Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
|
|
4
|
-
|
|
5
|
-
# Use the database for sessions instead of the cookie-based default,
|
|
6
|
-
# which shouldn't be used to store highly confidential information
|
|
7
|
-
# (create the session table with "rails generate session_migration")
|
|
8
|
-
# Dummy::Application.config.session_store :active_record_store
|
data/spec/dummy/config.ru
DELETED
data/spec/dummy/public/404.html
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>The page you were looking for doesn't exist (404)</title>
|
|
5
|
-
<style type="text/css">
|
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
-
div.dialog {
|
|
8
|
-
width: 25em;
|
|
9
|
-
padding: 0 4em;
|
|
10
|
-
margin: 4em auto 0 auto;
|
|
11
|
-
border: 1px solid #ccc;
|
|
12
|
-
border-right-color: #999;
|
|
13
|
-
border-bottom-color: #999;
|
|
14
|
-
}
|
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<!-- This file lives in public/404.html -->
|
|
21
|
-
<div class="dialog">
|
|
22
|
-
<h1>The page you were looking for doesn't exist.</h1>
|
|
23
|
-
<p>You may have mistyped the address or the page may have moved.</p>
|
|
24
|
-
</div>
|
|
25
|
-
</body>
|
|
26
|
-
</html>
|
data/spec/dummy/public/422.html
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>The change you wanted was rejected (422)</title>
|
|
5
|
-
<style type="text/css">
|
|
6
|
-
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
-
div.dialog {
|
|
8
|
-
width: 25em;
|
|
9
|
-
padding: 0 4em;
|
|
10
|
-
margin: 4em auto 0 auto;
|
|
11
|
-
border: 1px solid #ccc;
|
|
12
|
-
border-right-color: #999;
|
|
13
|
-
border-bottom-color: #999;
|
|
14
|
-
}
|
|
15
|
-
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<!-- This file lives in public/422.html -->
|
|
21
|
-
<div class="dialog">
|
|
22
|
-
<h1>The change you wanted was rejected.</h1>
|
|
23
|
-
<p>Maybe you tried to change something you didn't have access to.</p>
|
|
24
|
-
</div>
|
|
25
|
-
</body>
|
|
26
|
-
</html>
|