pugin 0.6.4 → 0.7.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/Rakefile +3 -1
- data/app/views/pugin/components/_status.haml +3 -2
- data/app/views/pugin/constituencies/list/_list.html.haml +7 -5
- data/app/views/pugin/layouts/pugin.haml +2 -2
- data/config/locales/en.yml +5 -1
- data/lib/pugin.rb +23 -3
- data/lib/pugin/bandiera.rb +5 -0
- data/lib/pugin/feature.rb +25 -0
- data/lib/pugin/feature/bandiera.rb +30 -0
- data/lib/pugin/feature/simple_feature.rb +26 -0
- data/lib/pugin/feature/status_banner.rb +6 -0
- data/lib/pugin/feature/top_navigation.rb +6 -0
- data/lib/pugin/helpers/controller_helpers.rb +33 -0
- data/lib/pugin/version.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +12 -0
- data/spec/dummy/log/test.log +468 -0
- data/spec/lib/pugin/feature/bandiera_spec.rb +65 -0
- data/spec/lib/pugin/feature/simple_feature_spec.rb +53 -0
- data/spec/lib/pugin/feature/status_banner_spec.rb +53 -0
- data/spec/lib/pugin/feature/top_navigation_spec.rb +53 -0
- data/spec/lib/pugin/feature_spec.rb +30 -0
- data/spec/lib/pugin/helpers/controller_helpers_spec.rb +60 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/views/pugin/components/_status.html.haml_spec.rb +6 -24
- data/spec/views/pugin/constituencies/list/_list.html.haml_spec.rb +78 -0
- data/spec/views/pugin/elements/_list.html.haml_spec.rb +38 -0
- metadata +39 -4
- data/app/views/pugin/constituencies/list/current/_current_constituency.html.haml +0 -5
- data/app/views/pugin/constituencies/list/former/_former_constituency.html.haml +0 -2
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'haml'
|
3
|
+
|
4
|
+
describe 'pugin/components/_status.html.haml', type: :view do
|
5
|
+
|
6
|
+
it 'renders an ordered list when :ordered? is set to true' do
|
7
|
+
render partial: 'pugin/elements/list', locals: { ordered?: true, data: {} }
|
8
|
+
expect(response).to include('<ol class="list--box">')
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'renders an unordered list when :ordered? is not set' do
|
12
|
+
render partial: 'pugin/elements/list', locals: { data: {} }
|
13
|
+
expect(response).to include('<ul class="list--box">')
|
14
|
+
end
|
15
|
+
|
16
|
+
context 'without any data' do
|
17
|
+
it 'renders a no content message when there is no data' do
|
18
|
+
render partial: 'pugin/elements/list', locals: { data: {} }
|
19
|
+
expect(response).to include("There are no results")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'with data' do
|
24
|
+
|
25
|
+
before :each do
|
26
|
+
constituency = Class.new
|
27
|
+
allow(constituency).to receive(:current?).and_return(false)
|
28
|
+
allow(constituency).to receive(:name).and_return('Aberavon')
|
29
|
+
allow(constituency).to receive(:graph_id).and_return('123')
|
30
|
+
@constituencies = [constituency]
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'renders an internal partial if there is data' do
|
34
|
+
render partial: 'pugin/elements/list', locals: { item_type: "constituencies", data: @constituencies }
|
35
|
+
expect(response).to include("Former constituency")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Rayner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '5.0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: bandiera-client
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - '='
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: 3.0.4
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - '='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: 3.0.4
|
153
167
|
description: Pugin is a component-based pattern design library that holds all of the
|
154
168
|
reusable partials, styles and scripts for elements of UK Parliament microservices.
|
155
169
|
email:
|
@@ -185,8 +199,6 @@ files:
|
|
185
199
|
- app/views/pugin/components/_navigation-main.haml
|
186
200
|
- app/views/pugin/components/_status.haml
|
187
201
|
- app/views/pugin/constituencies/list/_list.html.haml
|
188
|
-
- app/views/pugin/constituencies/list/current/_current_constituency.html.haml
|
189
|
-
- app/views/pugin/constituencies/list/former/_former_constituency.html.haml
|
190
202
|
- app/views/pugin/elements/_list.html.haml
|
191
203
|
- app/views/pugin/elements/_skip-content.haml
|
192
204
|
- app/views/pugin/javascript/_google_tag_manager.haml
|
@@ -207,7 +219,14 @@ files:
|
|
207
219
|
- config/locales/en.yml
|
208
220
|
- config/routes.rb
|
209
221
|
- lib/pugin.rb
|
222
|
+
- lib/pugin/bandiera.rb
|
210
223
|
- lib/pugin/engine.rb
|
224
|
+
- lib/pugin/feature.rb
|
225
|
+
- lib/pugin/feature/bandiera.rb
|
226
|
+
- lib/pugin/feature/simple_feature.rb
|
227
|
+
- lib/pugin/feature/status_banner.rb
|
228
|
+
- lib/pugin/feature/top_navigation.rb
|
229
|
+
- lib/pugin/helpers/controller_helpers.rb
|
211
230
|
- lib/pugin/railtie.rb
|
212
231
|
- lib/pugin/version.rb
|
213
232
|
- lib/pugin/view_helpers.rb
|
@@ -415,6 +434,12 @@ files:
|
|
415
434
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/xQ/xqZ-eoq9eoAn2ZSThyKvxOBZn8X8DQe61k2rp0RDGsU.cache
|
416
435
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/yO/yOZ2Ba7Jpotgr3YdWqfI3Cn0RYGwu5JyUNBQgzzwuNs.cache
|
417
436
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/z2/z2UBDqCp2Md5BQvvfpsfKJatSRe3R7NCNvRBa4c6LrE.cache
|
437
|
+
- spec/lib/pugin/feature/bandiera_spec.rb
|
438
|
+
- spec/lib/pugin/feature/simple_feature_spec.rb
|
439
|
+
- spec/lib/pugin/feature/status_banner_spec.rb
|
440
|
+
- spec/lib/pugin/feature/top_navigation_spec.rb
|
441
|
+
- spec/lib/pugin/feature_spec.rb
|
442
|
+
- spec/lib/pugin/helpers/controller_helpers_spec.rb
|
418
443
|
- spec/pugin/engine_spec.rb
|
419
444
|
- spec/pugin_spec.rb
|
420
445
|
- spec/spec_helper.rb
|
@@ -424,6 +449,8 @@ files:
|
|
424
449
|
- spec/views/pugin/components/_navigation-letter.html.haml_spec.rb
|
425
450
|
- spec/views/pugin/components/_navigation-main.haml_spec.rb
|
426
451
|
- spec/views/pugin/components/_status.html.haml_spec.rb
|
452
|
+
- spec/views/pugin/constituencies/list/_list.html.haml_spec.rb
|
453
|
+
- spec/views/pugin/elements/_list.html.haml_spec.rb
|
427
454
|
- spec/views/pugin/layouts/pugin.html.haml_spec.rb
|
428
455
|
homepage: https://github.com/ukparliament/pugin
|
429
456
|
licenses:
|
@@ -653,6 +680,12 @@ test_files:
|
|
653
680
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/z2/z2UBDqCp2Md5BQvvfpsfKJatSRe3R7NCNvRBa4c6LrE.cache
|
654
681
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/Z9/Z98OlWQ5yjVk3HyW31BKb0htp-JZuXhQob92lbYzamM.cache
|
655
682
|
- spec/dummy/tmp/cache/assets/sprockets/v3.0/ZV/ZV09r_IOeXLQ297xQZFjI7h2bcHrB2Hdj29s7daojxM.cache
|
683
|
+
- spec/lib/pugin/feature/bandiera_spec.rb
|
684
|
+
- spec/lib/pugin/feature/simple_feature_spec.rb
|
685
|
+
- spec/lib/pugin/feature/status_banner_spec.rb
|
686
|
+
- spec/lib/pugin/feature/top_navigation_spec.rb
|
687
|
+
- spec/lib/pugin/feature_spec.rb
|
688
|
+
- spec/lib/pugin/helpers/controller_helpers_spec.rb
|
656
689
|
- spec/pugin/engine_spec.rb
|
657
690
|
- spec/pugin_spec.rb
|
658
691
|
- spec/spec_helper.rb
|
@@ -662,4 +695,6 @@ test_files:
|
|
662
695
|
- spec/views/pugin/components/_navigation-letter.html.haml_spec.rb
|
663
696
|
- spec/views/pugin/components/_navigation-main.haml_spec.rb
|
664
697
|
- spec/views/pugin/components/_status.html.haml_spec.rb
|
698
|
+
- spec/views/pugin/constituencies/list/_list.html.haml_spec.rb
|
699
|
+
- spec/views/pugin/elements/_list.html.haml_spec.rb
|
665
700
|
- spec/views/pugin/layouts/pugin.html.haml_spec.rb
|