push_type_core 0.7.0 → 0.8.0.beta.1
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/app/controllers/concerns/push_type/application_controller_methods.rb +1 -2
- data/app/controllers/front_end_controller.rb +16 -0
- data/app/fields/push_type/wysiwyg_field.rb +19 -0
- data/app/models/concerns/push_type/unexposable.rb +1 -2
- data/db/migrate/20160201150228_drop_legacy_push_type_taxonomies.rb +13 -0
- data/lib/push_type/config.rb +0 -4
- data/lib/push_type/core.rb +0 -4
- data/lib/push_type/rails/routes.rb +1 -7
- data/lib/push_type/testing/common_rake.rb +0 -2
- data/lib/push_type/testing/factories.rb +0 -5
- data/lib/push_type/testing/setup.rb +1 -1
- data/lib/push_type/version.rb +1 -1
- data/test/controllers/{nodes_front_end_controller_test.rb → front_end_controller_test.rb} +1 -1
- data/test/dummy/config/initializers/push_type.rb +1 -1
- data/test/dummy/config/secrets.yml +2 -2
- data/test/dummy/db/migrate/20160206155139_drop_legacy_push_type_taxonomies.push_type.rb +14 -0
- data/test/dummy/db/schema.rb +1 -21
- data/test/dummy/log/test.log +8013 -8654
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/0ANSDcZJu9gPyqtYPIW729qm1kriQ29Vn9LU8T2SGQU.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_d65qW7wxRtKVSYpmfSenECz5QUWVI9pppUgV7TA1Rk.cache +0 -0
- data/test/dummy/tmp/generators/app/presenters/page_presenter.rb +12 -0
- data/test/fields/push_type/wysiwyg_field_test.rb +23 -0
- data/test/lib/push_type/core_test.rb +0 -27
- metadata +38 -71
- data/app/controllers/nodes_front_end_controller.rb +0 -21
- data/app/controllers/taxonomies_front_end_controller.rb +0 -25
- data/app/models/push_type/taxonomy.rb +0 -44
- data/db/migrate/20150310115933_create_push_type_taxonomies.rb +0 -18
- data/db/migrate/20150310123230_create_push_type_taxonomy_hierarchies.rb +0 -16
- data/lib/generators/push_type/taxonomy/USAGE +0 -8
- data/lib/generators/push_type/taxonomy/taxonomy_generator.rb +0 -13
- data/lib/generators/push_type/taxonomy/templates/taxonomy.html.erb +0 -3
- data/lib/generators/push_type/taxonomy/templates/taxonomy.rb +0 -7
- data/test/controllers/taxonomies_front_end_controller_test.rb +0 -58
- data/test/dummy/app/models/category.rb +0 -7
- data/test/dummy/app/views/taxonomies/category.html.erb +0 -3
- data/test/dummy/db/migrate/20160122151528_create_push_type_taxonomies.push_type.rb +0 -19
- data/test/dummy/db/migrate/20160122151529_create_push_type_taxonomy_hierarchies.push_type.rb +0 -17
- data/test/dummy/tmp/generators/config/initializers/push_type.rb +0 -50
- data/test/dummy/tmp/generators/config/routes.rb +0 -59
- data/test/lib/generators/push_type/taxonomy_generator_test.rb +0 -17
- data/test/models/push_type/taxonomy_test.rb +0 -37
- /data/test/dummy/db/migrate/{20160122151524_create_push_type_users.push_type.rb → 20160206155134_create_push_type_users.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20160122151525_create_push_type_nodes.push_type.rb → 20160206155135_create_push_type_nodes.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20160122151526_create_push_type_node_hierarchies.push_type.rb → 20160206155136_create_push_type_node_hierarchies.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20160122151527_create_push_type_assets.push_type.rb → 20160206155137_create_push_type_assets.push_type.rb} +0 -0
- /data/test/dummy/db/migrate/{20160122151530_add_field_store_default_values.push_type.rb → 20160206155138_add_field_store_default_values.push_type.rb} +0 -0
- /data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{A0UfNVcNn48aSCOiAvcHrJ1BASyXJCELidVIQ6drqQM.cache → BXXMCMRu7JahLHdf-HLwTSs6u6Pfn4DhDNK5wg5hgy0.cache} +0 -0
- /data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/{RLSLZQ8zubBDFwRzJo2WPXEPjX3gpp-T1h5FK-UnAYo.cache → TUwu9oRcnc80mNVFDhhX5AqieKa5hmp5Ro9HIoQjdA4.cache} +0 -0
Binary file
|
Binary file
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class PagePresenter < PushType::Presenter
|
2
|
+
|
3
|
+
# This class delegates to the model, Page
|
4
|
+
# Override any methods to add custom presentation logic
|
5
|
+
# View helpers are accessible from the `h` method
|
6
|
+
|
7
|
+
# Example:
|
8
|
+
# def title
|
9
|
+
# h.content_tag :strong, super()
|
10
|
+
# end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module PushType
|
4
|
+
class WysiwygFieldTest < ActiveSupport::TestCase
|
5
|
+
|
6
|
+
class TestPage < PushType::Node
|
7
|
+
field :foo, :wysiwyg, toolbar: 'text'
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:node) { TestPage.create FactoryGirl.attributes_for(:node, foo: val) }
|
11
|
+
let(:val) { 'abc' }
|
12
|
+
let(:field) { node.fields[:foo] }
|
13
|
+
|
14
|
+
it { field.form_helper.must_equal :text_area }
|
15
|
+
it { field.toolbar.must_equal 'text' }
|
16
|
+
it { field.html_options[:'froala-toolbar'].must_equal 'text' }
|
17
|
+
it { field.json_value.must_equal val }
|
18
|
+
it { field.value.must_equal val }
|
19
|
+
|
20
|
+
it { node.foo.must_equal val }
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
@@ -13,7 +13,6 @@ module PushType
|
|
13
13
|
it { subject.must_respond_to :root_nodes }
|
14
14
|
it { subject.must_respond_to :home_slug }
|
15
15
|
it { subject.must_respond_to :unexposed_nodes }
|
16
|
-
it { subject.must_respond_to :unexposed_taxonomies }
|
17
16
|
it { subject.must_respond_to :media_styles }
|
18
17
|
it { subject.must_respond_to :mailer_sender }
|
19
18
|
it { subject.must_respond_to :home_slug }
|
@@ -44,17 +43,6 @@ module PushType
|
|
44
43
|
end
|
45
44
|
end
|
46
45
|
|
47
|
-
describe '.unexposed_taxonomies' do
|
48
|
-
let(:config) { MiniTest::Mock.new }
|
49
|
-
it 'should return empty array by default' do
|
50
|
-
config.expect :unexposed_taxonomies, []
|
51
|
-
PushType.stub :config, config do
|
52
|
-
PushType.unexposed_taxonomies.must_be_empty
|
53
|
-
end
|
54
|
-
assert config.verify
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
46
|
describe '.subclasses_from_list' do
|
59
47
|
subject { PushType.subclasses_from_list scope, list }
|
60
48
|
describe 'scoped by :node' do
|
@@ -72,21 +60,6 @@ module PushType
|
|
72
60
|
it { subject.must_equal ['page', 'test_page'] }
|
73
61
|
end
|
74
62
|
end
|
75
|
-
describe 'scoped by :taxonomy' do
|
76
|
-
let(:scope) { :taxonomy }
|
77
|
-
describe 'searching for :all' do
|
78
|
-
let(:list) { :all }
|
79
|
-
it { subject.size.must_be :>=, 1 }
|
80
|
-
end
|
81
|
-
describe 'searching for single type' do
|
82
|
-
let(:list) { :category }
|
83
|
-
it { subject.must_equal ['category'] }
|
84
|
-
end
|
85
|
-
describe 'searching for array with nonexisting types' do
|
86
|
-
let(:list) { [:category, :foo, :bar] }
|
87
|
-
it { subject.must_equal ['category'] }
|
88
|
-
end
|
89
|
-
end
|
90
63
|
end
|
91
64
|
|
92
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: push_type_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Russell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.18.
|
33
|
+
version: 0.18.4
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.18.
|
40
|
+
version: 0.18.4
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: closure_tree
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,70 +58,56 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.0.
|
61
|
+
version: 1.0.12
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.0.
|
68
|
+
version: 1.0.12
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: redcarpet
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3.3.
|
75
|
+
version: 3.3.4
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.3.
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: active_attr
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - '='
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 0.8.5
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - '='
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 0.8.5
|
82
|
+
version: 3.3.4
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: minitest-spec-rails
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
87
|
- - "~>"
|
102
88
|
- !ruby/object:Gem::Version
|
103
|
-
version: 5.
|
89
|
+
version: 5.3.0
|
104
90
|
type: :development
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
94
|
- - "~>"
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version: 5.
|
96
|
+
version: 5.3.0
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: database_cleaner
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
101
|
- - "~>"
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
103
|
+
version: 1.5.1
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
108
|
- - "~>"
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
110
|
+
version: 1.5.1
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
112
|
name: factory_girl_rails
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -152,8 +138,6 @@ files:
|
|
152
138
|
- app/controllers/concerns/push_type/application_controller_methods.rb
|
153
139
|
- app/controllers/concerns/push_type/filterable.rb
|
154
140
|
- app/controllers/front_end_controller.rb
|
155
|
-
- app/controllers/nodes_front_end_controller.rb
|
156
|
-
- app/controllers/taxonomies_front_end_controller.rb
|
157
141
|
- app/fields/push_type/asset_field.rb
|
158
142
|
- app/fields/push_type/boolean_field.rb
|
159
143
|
- app/fields/push_type/date_field.rb
|
@@ -168,6 +152,7 @@ files:
|
|
168
152
|
- app/fields/push_type/tag_list_field.rb
|
169
153
|
- app/fields/push_type/text_field.rb
|
170
154
|
- app/fields/push_type/time_field.rb
|
155
|
+
- app/fields/push_type/wysiwyg_field.rb
|
171
156
|
- app/helpers/push_type/application_helper.rb
|
172
157
|
- app/models/concerns/push_type/customizable.rb
|
173
158
|
- app/models/concerns/push_type/nestable.rb
|
@@ -179,7 +164,6 @@ files:
|
|
179
164
|
- app/models/push_type/asset.rb
|
180
165
|
- app/models/push_type/node.rb
|
181
166
|
- app/models/push_type/structure.rb
|
182
|
-
- app/models/push_type/taxonomy.rb
|
183
167
|
- app/models/push_type/user.rb
|
184
168
|
- app/views/layouts/push_type/application.html.erb
|
185
169
|
- app/views/push_type/setup.html.erb
|
@@ -190,9 +174,8 @@ files:
|
|
190
174
|
- db/migrate/20141117204630_create_push_type_nodes.rb
|
191
175
|
- db/migrate/20141117210644_create_push_type_node_hierarchies.rb
|
192
176
|
- db/migrate/20141127151930_create_push_type_assets.rb
|
193
|
-
- db/migrate/20150310115933_create_push_type_taxonomies.rb
|
194
|
-
- db/migrate/20150310123230_create_push_type_taxonomy_hierarchies.rb
|
195
177
|
- db/migrate/20150531183944_add_field_store_default_values.rb
|
178
|
+
- db/migrate/20160201150228_drop_legacy_push_type_taxonomies.rb
|
196
179
|
- lib/generators/push_type/dummy/dummy_generator.rb
|
197
180
|
- lib/generators/push_type/dummy/templates/application.rb
|
198
181
|
- lib/generators/push_type/dummy/templates/boot.rb
|
@@ -211,10 +194,6 @@ files:
|
|
211
194
|
- lib/generators/push_type/structure/USAGE
|
212
195
|
- lib/generators/push_type/structure/structure_generator.rb
|
213
196
|
- lib/generators/push_type/structure/templates/structure.rb
|
214
|
-
- lib/generators/push_type/taxonomy/USAGE
|
215
|
-
- lib/generators/push_type/taxonomy/taxonomy_generator.rb
|
216
|
-
- lib/generators/push_type/taxonomy/templates/taxonomy.html.erb
|
217
|
-
- lib/generators/push_type/taxonomy/templates/taxonomy.rb
|
218
197
|
- lib/push_type/config.rb
|
219
198
|
- lib/push_type/core.rb
|
220
199
|
- lib/push_type/core/engine.rb
|
@@ -243,19 +222,16 @@ files:
|
|
243
222
|
- lib/push_type/version.rb
|
244
223
|
- lib/push_type_core.rb
|
245
224
|
- lib/tasks/push_type_tasks.rake
|
246
|
-
- test/controllers/
|
247
|
-
- test/controllers/taxonomies_front_end_controller_test.rb
|
225
|
+
- test/controllers/front_end_controller_test.rb
|
248
226
|
- test/dummy/README.rdoc
|
249
227
|
- test/dummy/Rakefile
|
250
228
|
- test/dummy/app/assets/stylesheets/application.css
|
251
229
|
- test/dummy/app/controllers/application_controller.rb
|
252
230
|
- test/dummy/app/helpers/application_helper.rb
|
253
|
-
- test/dummy/app/models/category.rb
|
254
231
|
- test/dummy/app/models/location.rb
|
255
232
|
- test/dummy/app/models/page.rb
|
256
233
|
- test/dummy/app/views/layouts/application.html.erb
|
257
234
|
- test/dummy/app/views/nodes/page.html.erb
|
258
|
-
- test/dummy/app/views/taxonomies/category.html.erb
|
259
235
|
- test/dummy/bin/bundle
|
260
236
|
- test/dummy/bin/rails
|
261
237
|
- test/dummy/bin/rake
|
@@ -280,13 +256,12 @@ files:
|
|
280
256
|
- test/dummy/config/locales/en.yml
|
281
257
|
- test/dummy/config/routes.rb
|
282
258
|
- test/dummy/config/secrets.yml
|
283
|
-
- test/dummy/db/migrate/
|
284
|
-
- test/dummy/db/migrate/
|
285
|
-
- test/dummy/db/migrate/
|
286
|
-
- test/dummy/db/migrate/
|
287
|
-
- test/dummy/db/migrate/
|
288
|
-
- test/dummy/db/migrate/
|
289
|
-
- test/dummy/db/migrate/20160122151530_add_field_store_default_values.push_type.rb
|
259
|
+
- test/dummy/db/migrate/20160206155134_create_push_type_users.push_type.rb
|
260
|
+
- test/dummy/db/migrate/20160206155135_create_push_type_nodes.push_type.rb
|
261
|
+
- test/dummy/db/migrate/20160206155136_create_push_type_node_hierarchies.push_type.rb
|
262
|
+
- test/dummy/db/migrate/20160206155137_create_push_type_assets.push_type.rb
|
263
|
+
- test/dummy/db/migrate/20160206155138_add_field_store_default_values.push_type.rb
|
264
|
+
- test/dummy/db/migrate/20160206155139_drop_legacy_push_type_taxonomies.push_type.rb
|
290
265
|
- test/dummy/db/schema.rb
|
291
266
|
- test/dummy/db/seeds.rb
|
292
267
|
- test/dummy/log/test.log
|
@@ -298,13 +273,12 @@ files:
|
|
298
273
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/0ANSDcZJu9gPyqtYPIW729qm1kriQ29Vn9LU8T2SGQU.cache
|
299
274
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/3T6ioyhwSsEzte_a9viHBvfmuKgORQ019srIEoUYkVs.cache
|
300
275
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache
|
301
|
-
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/
|
276
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/BXXMCMRu7JahLHdf-HLwTSs6u6Pfn4DhDNK5wg5hgy0.cache
|
302
277
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/IYzwMwq7DWWSuojH6oXsrP__pcD7O8TQieMFSzQiwnc.cache
|
303
278
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache
|
304
|
-
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/
|
279
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/TUwu9oRcnc80mNVFDhhX5AqieKa5hmp5Ro9HIoQjdA4.cache
|
305
280
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/_d65qW7wxRtKVSYpmfSenECz5QUWVI9pppUgV7TA1Rk.cache
|
306
|
-
- test/dummy/tmp/generators/
|
307
|
-
- test/dummy/tmp/generators/config/routes.rb
|
281
|
+
- test/dummy/tmp/generators/app/presenters/page_presenter.rb
|
308
282
|
- test/fields/push_type/asset_field_test.rb
|
309
283
|
- test/fields/push_type/boolean_field_test.rb
|
310
284
|
- test/fields/push_type/date_field_test.rb
|
@@ -319,6 +293,7 @@ files:
|
|
319
293
|
- test/fields/push_type/tag_list_field_test.rb
|
320
294
|
- test/fields/push_type/text_field_test.rb
|
321
295
|
- test/fields/push_type/time_field_test.rb
|
296
|
+
- test/fields/push_type/wysiwyg_field_test.rb
|
322
297
|
- test/files/audio.m3u
|
323
298
|
- test/files/document.pdf
|
324
299
|
- test/files/image.png
|
@@ -328,7 +303,6 @@ files:
|
|
328
303
|
- test/lib/generators/push_type/node_generator_test.rb
|
329
304
|
- test/lib/generators/push_type/presenter_generator_test.rb
|
330
305
|
- test/lib/generators/push_type/structure_generator_test.rb
|
331
|
-
- test/lib/generators/push_type/taxonomy_generator_test.rb
|
332
306
|
- test/lib/push_type/core_exts_test.rb
|
333
307
|
- test/lib/push_type/core_test.rb
|
334
308
|
- test/lib/push_type/field_type_test.rb
|
@@ -349,7 +323,6 @@ files:
|
|
349
323
|
- test/models/concerns/push_type/unexposable_test.rb
|
350
324
|
- test/models/push_type/asset_test.rb
|
351
325
|
- test/models/push_type/node_test.rb
|
352
|
-
- test/models/push_type/taxonomy_test.rb
|
353
326
|
- test/models/push_type/user_test.rb
|
354
327
|
- test/test_helper.rb
|
355
328
|
homepage: http://www.pushtype.org
|
@@ -367,9 +340,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
367
340
|
version: '0'
|
368
341
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
369
342
|
requirements:
|
370
|
-
- - "
|
343
|
+
- - ">"
|
371
344
|
- !ruby/object:Gem::Version
|
372
|
-
version:
|
345
|
+
version: 1.3.1
|
373
346
|
requirements: []
|
374
347
|
rubyforge_project:
|
375
348
|
rubygems_version: 2.4.2
|
@@ -377,17 +350,14 @@ signing_key:
|
|
377
350
|
specification_version: 4
|
378
351
|
summary: The core engine for PushType CMS.
|
379
352
|
test_files:
|
380
|
-
- test/controllers/
|
381
|
-
- test/controllers/taxonomies_front_end_controller_test.rb
|
353
|
+
- test/controllers/front_end_controller_test.rb
|
382
354
|
- test/dummy/app/assets/stylesheets/application.css
|
383
355
|
- test/dummy/app/controllers/application_controller.rb
|
384
356
|
- test/dummy/app/helpers/application_helper.rb
|
385
|
-
- test/dummy/app/models/category.rb
|
386
357
|
- test/dummy/app/models/location.rb
|
387
358
|
- test/dummy/app/models/page.rb
|
388
359
|
- test/dummy/app/views/layouts/application.html.erb
|
389
360
|
- test/dummy/app/views/nodes/page.html.erb
|
390
|
-
- test/dummy/app/views/taxonomies/category.html.erb
|
391
361
|
- test/dummy/bin/bundle
|
392
362
|
- test/dummy/bin/rails
|
393
363
|
- test/dummy/bin/rake
|
@@ -412,13 +382,12 @@ test_files:
|
|
412
382
|
- test/dummy/config/routes.rb
|
413
383
|
- test/dummy/config/secrets.yml
|
414
384
|
- test/dummy/config.ru
|
415
|
-
- test/dummy/db/migrate/
|
416
|
-
- test/dummy/db/migrate/
|
417
|
-
- test/dummy/db/migrate/
|
418
|
-
- test/dummy/db/migrate/
|
419
|
-
- test/dummy/db/migrate/
|
420
|
-
- test/dummy/db/migrate/
|
421
|
-
- test/dummy/db/migrate/20160122151530_add_field_store_default_values.push_type.rb
|
385
|
+
- test/dummy/db/migrate/20160206155134_create_push_type_users.push_type.rb
|
386
|
+
- test/dummy/db/migrate/20160206155135_create_push_type_nodes.push_type.rb
|
387
|
+
- test/dummy/db/migrate/20160206155136_create_push_type_node_hierarchies.push_type.rb
|
388
|
+
- test/dummy/db/migrate/20160206155137_create_push_type_assets.push_type.rb
|
389
|
+
- test/dummy/db/migrate/20160206155138_add_field_store_default_values.push_type.rb
|
390
|
+
- test/dummy/db/migrate/20160206155139_drop_legacy_push_type_taxonomies.push_type.rb
|
422
391
|
- test/dummy/db/schema.rb
|
423
392
|
- test/dummy/db/seeds.rb
|
424
393
|
- test/dummy/log/test.log
|
@@ -433,12 +402,11 @@ test_files:
|
|
433
402
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/3T6ioyhwSsEzte_a9viHBvfmuKgORQ019srIEoUYkVs.cache
|
434
403
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache
|
435
404
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/_d65qW7wxRtKVSYpmfSenECz5QUWVI9pppUgV7TA1Rk.cache
|
436
|
-
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/
|
405
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/BXXMCMRu7JahLHdf-HLwTSs6u6Pfn4DhDNK5wg5hgy0.cache
|
437
406
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/IYzwMwq7DWWSuojH6oXsrP__pcD7O8TQieMFSzQiwnc.cache
|
438
407
|
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache
|
439
|
-
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/
|
440
|
-
- test/dummy/tmp/generators/
|
441
|
-
- test/dummy/tmp/generators/config/routes.rb
|
408
|
+
- test/dummy/tmp/cache/assets/test/sprockets/v3.0/TUwu9oRcnc80mNVFDhhX5AqieKa5hmp5Ro9HIoQjdA4.cache
|
409
|
+
- test/dummy/tmp/generators/app/presenters/page_presenter.rb
|
442
410
|
- test/fields/push_type/asset_field_test.rb
|
443
411
|
- test/fields/push_type/boolean_field_test.rb
|
444
412
|
- test/fields/push_type/date_field_test.rb
|
@@ -453,6 +421,7 @@ test_files:
|
|
453
421
|
- test/fields/push_type/tag_list_field_test.rb
|
454
422
|
- test/fields/push_type/text_field_test.rb
|
455
423
|
- test/fields/push_type/time_field_test.rb
|
424
|
+
- test/fields/push_type/wysiwyg_field_test.rb
|
456
425
|
- test/files/audio.m3u
|
457
426
|
- test/files/document.pdf
|
458
427
|
- test/files/image.png
|
@@ -462,7 +431,6 @@ test_files:
|
|
462
431
|
- test/lib/generators/push_type/node_generator_test.rb
|
463
432
|
- test/lib/generators/push_type/presenter_generator_test.rb
|
464
433
|
- test/lib/generators/push_type/structure_generator_test.rb
|
465
|
-
- test/lib/generators/push_type/taxonomy_generator_test.rb
|
466
434
|
- test/lib/push_type/core_exts_test.rb
|
467
435
|
- test/lib/push_type/core_test.rb
|
468
436
|
- test/lib/push_type/field_type_test.rb
|
@@ -483,6 +451,5 @@ test_files:
|
|
483
451
|
- test/models/concerns/push_type/unexposable_test.rb
|
484
452
|
- test/models/push_type/asset_test.rb
|
485
453
|
- test/models/push_type/node_test.rb
|
486
|
-
- test/models/push_type/taxonomy_test.rb
|
487
454
|
- test/models/push_type/user_test.rb
|
488
455
|
- test/test_helper.rb
|
@@ -1,21 +0,0 @@
|
|
1
|
-
class NodesFrontEndController < FrontEndController
|
2
|
-
|
3
|
-
before_action :load_node, only: :show
|
4
|
-
hooks_for :node, only: :show
|
5
|
-
|
6
|
-
def show
|
7
|
-
render *@node.template_args
|
8
|
-
end
|
9
|
-
|
10
|
-
private
|
11
|
-
|
12
|
-
def load_node
|
13
|
-
@node = PushType::Node.exposed.published.find_by_path permalink_path
|
14
|
-
if @node
|
15
|
-
instance_variable_set "@#{ @node.type.underscore }", @node.present!(view_context)
|
16
|
-
else
|
17
|
-
raise_404
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
class TaxonomiesFrontEndController < FrontEndController
|
2
|
-
|
3
|
-
before_action :load_taxonomy, only: :show
|
4
|
-
hooks_for :taxonomy, only: :show
|
5
|
-
|
6
|
-
def show
|
7
|
-
render *@taxonomy.template_args
|
8
|
-
end
|
9
|
-
|
10
|
-
private
|
11
|
-
|
12
|
-
def load_taxonomy
|
13
|
-
@taxonomy = taxonomy_class.find_by_path(permalink_path)
|
14
|
-
if @taxonomy
|
15
|
-
instance_variable_set "@#{ @taxonomy.type.underscore }", @taxonomy
|
16
|
-
else
|
17
|
-
raise_404
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def taxonomy_class
|
22
|
-
PushType::Taxonomy.descendants(exposed: true).find { |t| t.base_slug == params[:taxonomy] } or raise_404
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
module PushType
|
2
|
-
class Taxonomy < ActiveRecord::Base
|
3
|
-
|
4
|
-
include PushType::Templatable
|
5
|
-
include PushType::Unexposable
|
6
|
-
|
7
|
-
acts_as_tree name_column: 'slug', order: 'sort_order', dependent: :destroy
|
8
|
-
|
9
|
-
validates :title, presence: true, uniqueness: { scope: :parent_id }
|
10
|
-
validates :slug, presence: true, uniqueness: { scope: :parent_id }
|
11
|
-
|
12
|
-
class << self
|
13
|
-
def title
|
14
|
-
@title ||= name.underscore.humanize.pluralize
|
15
|
-
end
|
16
|
-
|
17
|
-
def base_slug(*args)
|
18
|
-
if args.present?
|
19
|
-
@base_slug = args.first
|
20
|
-
else
|
21
|
-
( @base_slug || name ).to_s.underscore
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def base_slug
|
27
|
-
self.class.base_slug
|
28
|
-
end
|
29
|
-
|
30
|
-
def permalink(with_base_sug = false)
|
31
|
-
@permalink ||= self_and_ancestors.map(&:slug).reverse
|
32
|
-
(with_base_sug ? @permalink.unshift(base_slug) : @permalink).join('/')
|
33
|
-
end
|
34
|
-
|
35
|
-
def full_permalink
|
36
|
-
permalink(true)
|
37
|
-
end
|
38
|
-
|
39
|
-
def exposed?
|
40
|
-
self.class.exposed?
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
class CreatePushTypeTaxonomies < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
enable_extension 'uuid-ossp' unless extension_enabled?('uuid-ossp')
|
4
|
-
create_table :push_type_taxonomies, id: :uuid, default: 'uuid_generate_v4()' do |t|
|
5
|
-
t.string :type
|
6
|
-
t.string :title
|
7
|
-
t.string :slug
|
8
|
-
|
9
|
-
t.uuid :parent_id
|
10
|
-
t.integer :sort_order
|
11
|
-
|
12
|
-
t.timestamps null: false
|
13
|
-
end
|
14
|
-
|
15
|
-
# Also add a tags array to Assets
|
16
|
-
add_column :push_type_assets, :tags, :string, array: true
|
17
|
-
end
|
18
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
class CreatePushTypeTaxonomyHierarchies < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :push_type_taxonomy_hierarchies, id: false do |t|
|
4
|
-
t.uuid :ancestor_id, null: false
|
5
|
-
t.uuid :descendant_id, null: false
|
6
|
-
t.integer :generations, null: false
|
7
|
-
end
|
8
|
-
|
9
|
-
add_index :push_type_taxonomy_hierarchies, [:ancestor_id, :descendant_id, :generations],
|
10
|
-
unique: true,
|
11
|
-
name: "taxonomy_anc_desc_idx"
|
12
|
-
|
13
|
-
add_index :push_type_taxonomy_hierarchies, [:descendant_id],
|
14
|
-
name: "taxonomy_desc_idx"
|
15
|
-
end
|
16
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
module PushType
|
2
|
-
class TaxonomyGenerator < Rails::Generators::NamedBase
|
3
|
-
source_root File.expand_path('../templates', __FILE__)
|
4
|
-
|
5
|
-
def create_field
|
6
|
-
template 'taxonomy.rb', "app/models/#{ file_name }.rb"
|
7
|
-
template 'taxonomy.html.erb', "app/views/taxonomies/#{ file_name }.html.erb"
|
8
|
-
end
|
9
|
-
|
10
|
-
hook_for :test_framework, as: :model
|
11
|
-
hide!
|
12
|
-
end
|
13
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class TaxonomiesFrontEndControllerTest < ActionController::TestCase
|
4
|
-
|
5
|
-
before { @routes = Rails.application.routes }
|
6
|
-
|
7
|
-
describe 'GET #show' do
|
8
|
-
let(:category) { Category.create FactoryGirl.attributes_for(:taxonomy) }
|
9
|
-
let(:taxonomy) { category.base_slug }
|
10
|
-
let(:permalink) { category.slug }
|
11
|
-
let(:action!) { get :show, taxonomy: taxonomy, permalink: permalink }
|
12
|
-
|
13
|
-
describe 'when taxonomy class does not exist' do
|
14
|
-
let(:taxonomy) { 'noop' }
|
15
|
-
it { proc { action! }.must_raise ActiveRecord::RecordNotFound }
|
16
|
-
end
|
17
|
-
describe 'when taxonomy term does not exist' do
|
18
|
-
let(:permalink) { 'does/not/exist' }
|
19
|
-
it { proc { action! }.must_raise ActiveRecord::RecordNotFound }
|
20
|
-
end
|
21
|
-
describe 'when taxonomy term does exist' do
|
22
|
-
before { action! }
|
23
|
-
it { response.must_render_template 'taxonomies/category' }
|
24
|
-
it { assigns[:taxonomy].must_equal category }
|
25
|
-
it { assigns[:category].must_equal category }
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
describe 'taxonomy filters' do
|
30
|
-
ApplicationController.module_eval do
|
31
|
-
before_taxonomy_load { @foo = {} }
|
32
|
-
before_taxonomy_action { @foo[:taxonomy_action] = true }
|
33
|
-
before_taxonomy_action(only: :category) { @foo[:category_action] = true }
|
34
|
-
before_taxonomy_action(only: :foo) { @foo[:foo_action] = true }
|
35
|
-
before_taxonomy_action(except: :category) { @foo[:except_category_action] = true }
|
36
|
-
before_taxonomy_action(except: :foo) { @foo[:except_foo_action] = true }
|
37
|
-
before_taxonomy_action :test_1, :test_2
|
38
|
-
private
|
39
|
-
def test_1
|
40
|
-
@foo[:test_1] = true
|
41
|
-
end
|
42
|
-
def test_2
|
43
|
-
@foo[:test_2] = true
|
44
|
-
end
|
45
|
-
end
|
46
|
-
let(:category) { Category.create FactoryGirl.attributes_for(:taxonomy) }
|
47
|
-
before { get :show, taxonomy: category.base_slug, permalink: category.slug }
|
48
|
-
it { assigns[:foo].must_be_instance_of Hash }
|
49
|
-
it { assigns[:foo][:taxonomy_action].must_equal true }
|
50
|
-
it { assigns[:foo][:category_action].must_equal true }
|
51
|
-
it { assigns[:foo][:foo_action].wont_be :present? }
|
52
|
-
it { assigns[:foo][:except_category_action].wont_be :present? }
|
53
|
-
it { assigns[:foo][:except_foo_action].must_equal true }
|
54
|
-
it { assigns[:foo][:test_1].must_equal true }
|
55
|
-
it { assigns[:foo][:test_2].must_equal true }
|
56
|
-
end
|
57
|
-
|
58
|
-
end
|