slimmer 3.18.0 → 3.19.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.
@@ -77,10 +77,7 @@ module Slimmer
77
77
  "content_with_tag" => {"web_url" => details[:section_link]},
78
78
  }
79
79
  if details[:parent]
80
- tag["parent"] = {"title" => details[:parent][:section_name],
81
- "details" => {"type" => "section"},
82
- "content_with_tag" => {"web_url" => details[:parent][:section_link]},
83
- }
80
+ tag["parent"] = slimmer_section_tag_for_details(details[:parent])
84
81
  end
85
82
  tag
86
83
  end
@@ -1,3 +1,3 @@
1
1
  module Slimmer
2
- VERSION = '3.18.0'
2
+ VERSION = '3.19.0'
3
3
  end
data/test/headers_test.rb CHANGED
@@ -179,5 +179,35 @@ describe Slimmer::Headers do
179
179
  assert_equal "section", artefact["tags"][0]["details"]["type"]
180
180
  assert_equal "/something/foo", artefact["tags"][0]["content_with_tag"]["web_url"]
181
181
  end
182
+
183
+ it "can set up a section tag with multiple levels of parents" do
184
+ self.set_slimmer_dummy_artefact(
185
+ :section_name => "Foo",
186
+ :section_link => "/something/baz/bar/foo",
187
+ :parent => {
188
+ :section_name => "Bar",
189
+ :section_link => "/something/baz/bar",
190
+ :parent => {
191
+ :section_name => "Baz",
192
+ :section_link => "/something/baz"
193
+ }
194
+ }
195
+ )
196
+
197
+ artefact = JSON.parse(headers[Slimmer::Headers::ARTEFACT_HEADER])
198
+
199
+ assert_equal "Foo", artefact["tags"][0]["title"]
200
+ assert_equal "section", artefact["tags"][0]["details"]["type"]
201
+ assert_equal "/something/baz/bar/foo", artefact["tags"][0]["content_with_tag"]["web_url"]
202
+
203
+ assert_equal "Bar", artefact["tags"][0]["parent"]["title"]
204
+ assert_equal "section", artefact["tags"][0]["parent"]["details"]["type"]
205
+ assert_equal "/something/baz/bar", artefact["tags"][0]["parent"]["content_with_tag"]["web_url"]
206
+
207
+ assert_equal "Baz", artefact["tags"][0]["parent"]["parent"]["title"]
208
+ assert_equal "section", artefact["tags"][0]["parent"]["parent"]["details"]["type"]
209
+ assert_equal "/something/baz", artefact["tags"][0]["parent"]["parent"]["content_with_tag"]["web_url"]
210
+
211
+ end
182
212
  end
183
213
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: slimmer
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 3.18.0
5
+ version: 3.19.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ben Griffiths
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2013-07-03 00:00:00 Z
14
+ date: 2013-07-23 00:00:00 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: nokogiri
@@ -180,62 +180,62 @@ extra_rdoc_files: []
180
180
  files:
181
181
  - README.md
182
182
  - CHANGELOG.md
183
- - lib/tasks/slimmer.rake
184
183
  - lib/slimmer.rb
185
- - lib/slimmer/skin.rb
186
- - lib/slimmer/railtie.rb
187
- - lib/slimmer/template.rb
188
- - lib/slimmer/test_template.rb
189
- - lib/slimmer/test.rb
190
184
  - lib/slimmer/app.rb
185
+ - lib/slimmer/test_template.rb
186
+ - lib/slimmer/version.rb
187
+ - lib/slimmer/railtie.rb
188
+ - lib/slimmer/processors/tag_mover.rb
189
+ - lib/slimmer/processors/body_class_copier.rb
191
190
  - lib/slimmer/processors/logo_class_inserter.rb
191
+ - lib/slimmer/processors/beta_notice_inserter.rb
192
+ - lib/slimmer/processors/header_context_inserter.rb
193
+ - lib/slimmer/processors/meta_viewport_remover.rb
192
194
  - lib/slimmer/processors/search_index_setter.rb
193
- - lib/slimmer/processors/body_class_copier.rb
194
- - lib/slimmer/processors/tag_mover.rb
195
+ - lib/slimmer/processors/report_a_problem_inserter.rb
196
+ - lib/slimmer/processors/navigation_mover.rb
197
+ - lib/slimmer/processors/campaign_notification_inserter.rb
198
+ - lib/slimmer/processors/footer_remover.rb
199
+ - lib/slimmer/processors/google_analytics_configurator.rb
195
200
  - lib/slimmer/processors/search_path_setter.rb
196
201
  - lib/slimmer/processors/title_inserter.rb
197
- - lib/slimmer/processors/google_analytics_configurator.rb
198
- - lib/slimmer/processors/navigation_mover.rb
199
- - lib/slimmer/processors/conditional_comment_mover.rb
200
202
  - lib/slimmer/processors/related_items_inserter.rb
201
- - lib/slimmer/processors/header_context_inserter.rb
202
- - lib/slimmer/processors/body_inserter.rb
203
- - lib/slimmer/processors/report_a_problem_inserter.rb
204
- - lib/slimmer/processors/meta_viewport_remover.rb
205
- - lib/slimmer/processors/campaign_notification_inserter.rb
206
- - lib/slimmer/processors/beta_notice_inserter.rb
207
203
  - lib/slimmer/processors/section_inserter.rb
208
- - lib/slimmer/processors/footer_remover.rb
209
- - lib/slimmer/headers.rb
210
- - lib/slimmer/version.rb
204
+ - lib/slimmer/processors/conditional_comment_mover.rb
205
+ - lib/slimmer/processors/body_inserter.rb
211
206
  - lib/slimmer/artefact.rb
207
+ - lib/slimmer/skin.rb
208
+ - lib/slimmer/headers.rb
209
+ - lib/slimmer/template.rb
210
+ - lib/slimmer/test.rb
211
+ - lib/tasks/slimmer.rake
212
212
  - Rakefile
213
- - test/headers_test.rb
214
- - test/artefact_test.rb
215
- - test/fixtures/related.raw.html.erb
216
- - test/fixtures/campaign.html.erb
217
- - test/fixtures/500.html.erb
218
- - test/fixtures/404.html.erb
219
- - test/fixtures/proposition_menu.html.erb
220
- - test/fixtures/beta_notice.html.erb
221
- - test/fixtures/wrapper.html.erb
222
- - test/fixtures/report_a_problem.raw.html.erb
223
- - test/skin_test.rb
224
- - test/processors/campaign_notification_inserter_test.rb
225
- - test/processors/meta_viewport_remover_test.rb
226
- - test/processors/logo_class_inserter_test.rb
213
+ - test/processors/header_context_inserter_test.rb
214
+ - test/processors/google_analytics_test.rb
227
215
  - test/processors/navigation_mover_test.rb
216
+ - test/processors/body_inserter_test.rb
228
217
  - test/processors/search_index_setter_test.rb
229
- - test/processors/google_analytics_test.rb
218
+ - test/processors/meta_viewport_remover_test.rb
230
219
  - test/processors/report_a_problem_inserter_test.rb
231
- - test/processors/body_inserter_test.rb
232
- - test/processors/search_path_setter_test.rb
233
220
  - test/processors/section_inserter_test.rb
221
+ - test/processors/campaign_notification_inserter_test.rb
222
+ - test/processors/search_path_setter_test.rb
234
223
  - test/processors/related_items_inserter_test.rb
235
- - test/processors/header_context_inserter_test.rb
236
- - test/typical_usage_test.rb
224
+ - test/processors/logo_class_inserter_test.rb
237
225
  - test/test_template_dependency_on_static_test.rb
226
+ - test/headers_test.rb
238
227
  - test/test_helper.rb
228
+ - test/typical_usage_test.rb
229
+ - test/artefact_test.rb
230
+ - test/skin_test.rb
231
+ - test/fixtures/campaign.html.erb
232
+ - test/fixtures/404.html.erb
233
+ - test/fixtures/beta_notice.html.erb
234
+ - test/fixtures/proposition_menu.html.erb
235
+ - test/fixtures/500.html.erb
236
+ - test/fixtures/wrapper.html.erb
237
+ - test/fixtures/related.raw.html.erb
238
+ - test/fixtures/report_a_problem.raw.html.erb
239
239
  - bin/render_slimmer_error
240
240
  homepage: http://github.com/alphagov/slimmer
241
241
  licenses: []
@@ -250,7 +250,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
250
  requirements:
251
251
  - - ">="
252
252
  - !ruby/object:Gem::Version
253
- hash: -4305673931480993366
253
+ hash: 4491266919277024024
254
254
  segments:
255
255
  - 0
256
256
  version: "0"
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  requirements:
260
260
  - - ">="
261
261
  - !ruby/object:Gem::Version
262
- hash: -4305673931480993366
262
+ hash: 4491266919277024024
263
263
  segments:
264
264
  - 0
265
265
  version: "0"
@@ -271,29 +271,29 @@ signing_key:
271
271
  specification_version: 3
272
272
  summary: Thinner than the skinner
273
273
  test_files:
274
- - test/headers_test.rb
275
- - test/artefact_test.rb
276
- - test/fixtures/related.raw.html.erb
277
- - test/fixtures/campaign.html.erb
278
- - test/fixtures/500.html.erb
279
- - test/fixtures/404.html.erb
280
- - test/fixtures/proposition_menu.html.erb
281
- - test/fixtures/beta_notice.html.erb
282
- - test/fixtures/wrapper.html.erb
283
- - test/fixtures/report_a_problem.raw.html.erb
284
- - test/skin_test.rb
285
- - test/processors/campaign_notification_inserter_test.rb
286
- - test/processors/meta_viewport_remover_test.rb
287
- - test/processors/logo_class_inserter_test.rb
274
+ - test/processors/header_context_inserter_test.rb
275
+ - test/processors/google_analytics_test.rb
288
276
  - test/processors/navigation_mover_test.rb
277
+ - test/processors/body_inserter_test.rb
289
278
  - test/processors/search_index_setter_test.rb
290
- - test/processors/google_analytics_test.rb
279
+ - test/processors/meta_viewport_remover_test.rb
291
280
  - test/processors/report_a_problem_inserter_test.rb
292
- - test/processors/body_inserter_test.rb
293
- - test/processors/search_path_setter_test.rb
294
281
  - test/processors/section_inserter_test.rb
282
+ - test/processors/campaign_notification_inserter_test.rb
283
+ - test/processors/search_path_setter_test.rb
295
284
  - test/processors/related_items_inserter_test.rb
296
- - test/processors/header_context_inserter_test.rb
297
- - test/typical_usage_test.rb
285
+ - test/processors/logo_class_inserter_test.rb
298
286
  - test/test_template_dependency_on_static_test.rb
287
+ - test/headers_test.rb
299
288
  - test/test_helper.rb
289
+ - test/typical_usage_test.rb
290
+ - test/artefact_test.rb
291
+ - test/skin_test.rb
292
+ - test/fixtures/campaign.html.erb
293
+ - test/fixtures/404.html.erb
294
+ - test/fixtures/beta_notice.html.erb
295
+ - test/fixtures/proposition_menu.html.erb
296
+ - test/fixtures/500.html.erb
297
+ - test/fixtures/wrapper.html.erb
298
+ - test/fixtures/related.raw.html.erb
299
+ - test/fixtures/report_a_problem.raw.html.erb