pugin 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +0 -0
- data/README.md +102 -0
- data/Rakefile +35 -0
- data/app/assets/config/pugin_manifest.js +2 -0
- data/app/assets/images/pugin/favicon.ico +0 -0
- data/app/assets/images/pugin/parliament-uk--darkgrey.png +0 -0
- data/app/assets/images/pugin/parliament-uk--darkgrey.svg +1 -0
- data/app/assets/images/pugin/parliament-uk--white-25.png +0 -0
- data/app/assets/images/pugin/parliament-uk--white-25.svg +1 -0
- data/app/assets/images/pugin/parliament-uk--white-50.png +0 -0
- data/app/assets/images/pugin/parliament-uk--white-50.svg +1 -0
- data/app/assets/images/pugin/parliament-uk-portcullis-black.png +0 -0
- data/app/assets/images/pugin/parliament-uk-portcullis-black.svg +1 -0
- data/app/assets/images/pugin/sprites-arrows.png +0 -0
- data/app/assets/images/pugin/sprites-arrows.svg +1 -0
- data/app/assets/javascripts/pugin/compiled/main.js +1 -0
- data/app/assets/javascripts/pugin/pugin.js +13 -0
- data/app/assets/stylesheets/pugin/compiled/main.css +1 -0
- data/app/assets/stylesheets/pugin/overrides/asset_overrides.css.erb +0 -0
- data/app/assets/stylesheets/pugin/pugin.css +16 -0
- data/app/views/pugin/cards/_person-list.html.haml +16 -0
- data/app/views/pugin/components/_footer.html.haml +16 -0
- data/app/views/pugin/components/_header.html.haml +7 -0
- data/app/views/pugin/components/_status.html.haml +6 -0
- data/app/views/pugin/javascript/_google_tag_manager.html.haml +5 -0
- data/app/views/pugin/javascript/_google_tag_manager_noscript.html.haml +2 -0
- data/app/views/pugin/layouts/pugin.html.haml +23 -0
- data/config/application.rb +0 -0
- data/config/routes.rb +2 -0
- data/lib/pugin.rb +5 -0
- data/lib/pugin/engine.rb +17 -0
- data/lib/pugin/version.rb +3 -0
- data/lib/tasks/pugin_tasks.rake +4 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +5 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +34 -0
- data/spec/dummy/bin/update +29 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/config/application.rb +23 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/cable.yml +9 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +54 -0
- data/spec/dummy/config/environments/production.rb +86 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/new_framework_defaults.rb +24 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/puma.rb +47 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/db/schema.rb +15 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/pugin/engine_spec.rb +17 -0
- data/spec/pugin_spec.rb +7 -0
- data/spec/spec_helper.rb +25 -0
- data/spec/views/pugin/cards/_person-list.html.haml_spec.rb +254 -0
- data/spec/views/pugin/components/_footer.html.haml_spec.rb +40 -0
- data/spec/views/pugin/components/_header.html.haml_spec.rb +27 -0
- data/spec/views/pugin/components/_status.html.haml_spec.rb +46 -0
- data/spec/views/pugin/layouts/pugin.html.haml_spec.rb +20 -0
- metadata +336 -0
@@ -0,0 +1,254 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'haml'
|
3
|
+
|
4
|
+
describe 'pugin/cards/_person-list.html.haml', type: :view do
|
5
|
+
|
6
|
+
let(:person) { Class.new }
|
7
|
+
let(:seat_incumbency1) { Class.new }
|
8
|
+
let(:seat_incumbency2) { Class.new }
|
9
|
+
let(:constituency1) { Class.new }
|
10
|
+
let(:constituency2) { Class.new }
|
11
|
+
let(:party_memberships1) { Class.new }
|
12
|
+
let(:party_memberships2) { Class.new }
|
13
|
+
let(:party1) { Class.new }
|
14
|
+
let(:party2) { Class.new }
|
15
|
+
|
16
|
+
context 'with a fully implemented person' do
|
17
|
+
|
18
|
+
before :each do
|
19
|
+
@people = [person]
|
20
|
+
allow(person).to receive(:full_name).and_return('Jane Smith')
|
21
|
+
allow(person).to receive(:graph_id).and_return('123')
|
22
|
+
|
23
|
+
allow(constituency1).to receive(:name).and_return('Hackney')
|
24
|
+
allow(constituency1).to receive(:graph_id).and_return('123')
|
25
|
+
allow(constituency2).to receive(:name).and_return('Stoke')
|
26
|
+
allow(constituency2).to receive(:graph_id).and_return('456')
|
27
|
+
|
28
|
+
allow(seat_incumbency1).to receive(:current?).and_return(true)
|
29
|
+
allow(seat_incumbency1).to receive(:constituency).and_return(constituency1)
|
30
|
+
|
31
|
+
allow(seat_incumbency2).to receive(:current?).and_return(false)
|
32
|
+
allow(seat_incumbency2).to receive(:constituency).and_return(constituency2)
|
33
|
+
|
34
|
+
allow(party1).to receive(:name).and_return('Labour')
|
35
|
+
allow(party1).to receive(:graph_id).and_return('123')
|
36
|
+
allow(party2).to receive(:name).and_return('Conservative')
|
37
|
+
allow(party2).to receive(:graph_id).and_return('456')
|
38
|
+
|
39
|
+
allow(party_memberships1).to receive(:current?).and_return(true)
|
40
|
+
allow(party_memberships1).to receive(:party).and_return(party1)
|
41
|
+
|
42
|
+
allow(party_memberships2).to receive(:current?).and_return(false)
|
43
|
+
allow(party_memberships2).to receive(:party).and_return(party2)
|
44
|
+
|
45
|
+
allow(person).to receive(:seat_incumbencies).and_return([seat_incumbency1, seat_incumbency2])
|
46
|
+
allow(person).to receive(:constituencies).and_return([constituency1,constituency2])
|
47
|
+
allow(person).to receive(:party_memberships).and_return([party_memberships1,party_memberships2])
|
48
|
+
allow(person).to receive(:parties).and_return([party1,party2])
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'displays all information as expected' do
|
52
|
+
render partial: 'pugin/cards/person-list', locals: { people: @people }
|
53
|
+
|
54
|
+
expect(rendered).to eq(
|
55
|
+
<<DATA
|
56
|
+
<ol class='list'>
|
57
|
+
<li class='list--item'>
|
58
|
+
<ul class='list'>
|
59
|
+
<li>
|
60
|
+
<a href='/people/123'>Jane Smith</a>
|
61
|
+
</li>
|
62
|
+
<li>
|
63
|
+
MP for
|
64
|
+
<a href='/constituencies/123'>Hackney</a>
|
65
|
+
</li>
|
66
|
+
<li>
|
67
|
+
<a href='/parties/123'>Labour</a>
|
68
|
+
</li>
|
69
|
+
</ul>
|
70
|
+
</li>
|
71
|
+
</ol>
|
72
|
+
DATA
|
73
|
+
)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
context 'with no data' do
|
78
|
+
let(:person) { Class.new }
|
79
|
+
|
80
|
+
before :each do
|
81
|
+
@people = [person]
|
82
|
+
allow(person).to receive(:constituencies).and_return([])
|
83
|
+
allow(person).to receive(:parties).and_return([])
|
84
|
+
end
|
85
|
+
|
86
|
+
it 'displays with no data' do
|
87
|
+
render partial: 'pugin/cards/person-list', locals: { people: @people }
|
88
|
+
|
89
|
+
expect(rendered).to eq(
|
90
|
+
<<DATA
|
91
|
+
<ol class='list'>
|
92
|
+
<li class='list--item'>
|
93
|
+
<ul class='list'>
|
94
|
+
</ul>
|
95
|
+
</li>
|
96
|
+
</ol>
|
97
|
+
DATA
|
98
|
+
)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
context 'with no name data' do
|
103
|
+
let(:person) { Class.new }
|
104
|
+
|
105
|
+
before :each do
|
106
|
+
@people = [person]
|
107
|
+
|
108
|
+
allow(constituency1).to receive(:name).and_return('Hackney')
|
109
|
+
allow(constituency1).to receive(:graph_id).and_return('123')
|
110
|
+
allow(constituency2).to receive(:name).and_return('Stoke')
|
111
|
+
allow(constituency2).to receive(:graph_id).and_return('456')
|
112
|
+
|
113
|
+
allow(seat_incumbency1).to receive(:current?).and_return(true)
|
114
|
+
allow(seat_incumbency1).to receive(:constituency).and_return(constituency1)
|
115
|
+
|
116
|
+
allow(seat_incumbency2).to receive(:current?).and_return(false)
|
117
|
+
allow(seat_incumbency2).to receive(:constituency).and_return(constituency2)
|
118
|
+
|
119
|
+
allow(party1).to receive(:name).and_return('Labour')
|
120
|
+
allow(party1).to receive(:graph_id).and_return('123')
|
121
|
+
allow(party2).to receive(:name).and_return('Conservative')
|
122
|
+
allow(party2).to receive(:graph_id).and_return('456')
|
123
|
+
|
124
|
+
allow(party_memberships1).to receive(:current?).and_return(true)
|
125
|
+
allow(party_memberships1).to receive(:party).and_return(party1)
|
126
|
+
|
127
|
+
allow(party_memberships2).to receive(:current?).and_return(false)
|
128
|
+
allow(party_memberships2).to receive(:party).and_return(party2)
|
129
|
+
|
130
|
+
allow(person).to receive(:seat_incumbencies).and_return([seat_incumbency1, seat_incumbency2])
|
131
|
+
allow(person).to receive(:constituencies).and_return([constituency1,constituency2])
|
132
|
+
allow(person).to receive(:party_memberships).and_return([party_memberships1,party_memberships2])
|
133
|
+
allow(person).to receive(:parties).and_return([party1,party2])
|
134
|
+
end
|
135
|
+
|
136
|
+
it 'displays with no name data' do
|
137
|
+
render partial: 'pugin/cards/person-list', locals: { people: @people }
|
138
|
+
|
139
|
+
expect(rendered).to eq(
|
140
|
+
<<DATA
|
141
|
+
<ol class='list'>
|
142
|
+
<li class='list--item'>
|
143
|
+
<ul class='list'>
|
144
|
+
<li>
|
145
|
+
MP for
|
146
|
+
<a href='/constituencies/123'>Hackney</a>
|
147
|
+
</li>
|
148
|
+
<li>
|
149
|
+
<a href='/parties/123'>Labour</a>
|
150
|
+
</li>
|
151
|
+
</ul>
|
152
|
+
</li>
|
153
|
+
</ol>
|
154
|
+
DATA
|
155
|
+
)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
context 'with no constituency data' do
|
160
|
+
let(:person) { Class.new }
|
161
|
+
|
162
|
+
before :each do
|
163
|
+
@people = [person]
|
164
|
+
|
165
|
+
allow(person).to receive(:full_name).and_return('Jane Smith')
|
166
|
+
allow(person).to receive(:graph_id).and_return('123')
|
167
|
+
|
168
|
+
allow(party1).to receive(:name).and_return('Labour')
|
169
|
+
allow(party1).to receive(:graph_id).and_return('123')
|
170
|
+
allow(party2).to receive(:name).and_return('Conservative')
|
171
|
+
allow(party2).to receive(:graph_id).and_return('456')
|
172
|
+
|
173
|
+
allow(party_memberships1).to receive(:current?).and_return(true)
|
174
|
+
allow(party_memberships1).to receive(:party).and_return(party1)
|
175
|
+
|
176
|
+
allow(party_memberships2).to receive(:current?).and_return(false)
|
177
|
+
allow(party_memberships2).to receive(:party).and_return(party2)
|
178
|
+
|
179
|
+
allow(person).to receive(:seat_incumbencies).and_return([seat_incumbency1, seat_incumbency2])
|
180
|
+
allow(person).to receive(:constituencies).and_return([])
|
181
|
+
allow(person).to receive(:party_memberships).and_return([party_memberships1,party_memberships2])
|
182
|
+
allow(person).to receive(:parties).and_return([party1,party2])
|
183
|
+
end
|
184
|
+
|
185
|
+
it 'displays with no constituency data' do
|
186
|
+
render partial: 'pugin/cards/person-list', locals: { people: @people }
|
187
|
+
|
188
|
+
expect(rendered).to eq(
|
189
|
+
<<DATA
|
190
|
+
<ol class='list'>
|
191
|
+
<li class='list--item'>
|
192
|
+
<ul class='list'>
|
193
|
+
<li>
|
194
|
+
<a href='/people/123'>Jane Smith</a>
|
195
|
+
</li>
|
196
|
+
<li>
|
197
|
+
<a href='/parties/123'>Labour</a>
|
198
|
+
</li>
|
199
|
+
</ul>
|
200
|
+
</li>
|
201
|
+
</ol>
|
202
|
+
DATA
|
203
|
+
)
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
context 'with no party data' do
|
208
|
+
let(:person) { Class.new }
|
209
|
+
|
210
|
+
before :each do
|
211
|
+
@people = [person]
|
212
|
+
allow(person).to receive(:full_name).and_return('Jane Smith')
|
213
|
+
allow(person).to receive(:graph_id).and_return('123')
|
214
|
+
|
215
|
+
allow(constituency1).to receive(:name).and_return('Hackney')
|
216
|
+
allow(constituency1).to receive(:graph_id).and_return('123')
|
217
|
+
allow(constituency2).to receive(:name).and_return('Stoke')
|
218
|
+
allow(constituency2).to receive(:graph_id).and_return('456')
|
219
|
+
|
220
|
+
allow(seat_incumbency1).to receive(:current?).and_return(true)
|
221
|
+
allow(seat_incumbency1).to receive(:constituency).and_return(constituency1)
|
222
|
+
|
223
|
+
allow(seat_incumbency2).to receive(:current?).and_return(false)
|
224
|
+
allow(seat_incumbency2).to receive(:constituency).and_return(constituency2)
|
225
|
+
|
226
|
+
allow(person).to receive(:seat_incumbencies).and_return([seat_incumbency1, seat_incumbency2])
|
227
|
+
allow(person).to receive(:constituencies).and_return([constituency1,constituency2])
|
228
|
+
allow(person).to receive(:party_memberships).and_return([party_memberships1,party_memberships2])
|
229
|
+
allow(person).to receive(:parties).and_return([])
|
230
|
+
end
|
231
|
+
|
232
|
+
it 'displays with no party data' do
|
233
|
+
render partial: 'pugin/cards/person-list', locals: { people: @people }
|
234
|
+
|
235
|
+
expect(rendered).to eq(
|
236
|
+
<<DATA
|
237
|
+
<ol class='list'>
|
238
|
+
<li class='list--item'>
|
239
|
+
<ul class='list'>
|
240
|
+
<li>
|
241
|
+
<a href='/people/123'>Jane Smith</a>
|
242
|
+
</li>
|
243
|
+
<li>
|
244
|
+
MP for
|
245
|
+
<a href='/constituencies/123'>Hackney</a>
|
246
|
+
</li>
|
247
|
+
</ul>
|
248
|
+
</li>
|
249
|
+
</ol>
|
250
|
+
DATA
|
251
|
+
)
|
252
|
+
end
|
253
|
+
end
|
254
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'haml'
|
3
|
+
|
4
|
+
describe 'pugin/components/_footer.html.haml', type: :view do
|
5
|
+
|
6
|
+
it 'renders as expected' do
|
7
|
+
render
|
8
|
+
|
9
|
+
expect(response).to eq(
|
10
|
+
<<DATA
|
11
|
+
<footer>
|
12
|
+
<div class='c-fs footer'>
|
13
|
+
<div class='c-fg'>
|
14
|
+
<div class='row--indent-horizontal'>
|
15
|
+
<div class='footer__logo'>
|
16
|
+
<img alt='parliament.uk' src='/images/parliament-uk--darkgrey.png' srcset='/images/parliament-uk--darkgrey.svg'>
|
17
|
+
</div>
|
18
|
+
<ul class='footer__list'>
|
19
|
+
<li>
|
20
|
+
Parliament.uk
|
21
|
+
<a href='https://pds.blog.parliament.uk/' target='_blank'>digital blog</a>
|
22
|
+
</li>
|
23
|
+
<li>
|
24
|
+
Visit the
|
25
|
+
<a href='https://www.parliament.uk/' target='_blank'>current parliament.uk</a>
|
26
|
+
website
|
27
|
+
</li>
|
28
|
+
<li>
|
29
|
+
<a href='/meta/cookie-policy'>Cookie Policy</a>
|
30
|
+
</li>
|
31
|
+
</ul>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
</footer>
|
36
|
+
DATA
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'haml'
|
3
|
+
|
4
|
+
describe 'pugin/components/_header.html.haml', type: :view do
|
5
|
+
|
6
|
+
it 'renders as expected' do
|
7
|
+
render
|
8
|
+
|
9
|
+
expect(response).to eq(<<DATA
|
10
|
+
<header>
|
11
|
+
<div class='c-fs header'>
|
12
|
+
<div class='c-fg'>
|
13
|
+
<div class='row--indent-horizontal'>
|
14
|
+
<div class='header__logo'>
|
15
|
+
<a href='/'>
|
16
|
+
<img alt='parliament.uk' src='#{Rails.application.secrets.asset_location_url}/images/parliament-uk--white.png' srcset='#{Rails.application.secrets.asset_location_url}/images/parliament-uk--white.svg'>
|
17
|
+
</a>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</header>
|
23
|
+
DATA
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'haml'
|
3
|
+
|
4
|
+
describe 'pugin/components/_status.html.haml', type: :view do
|
5
|
+
|
6
|
+
context 'without a status message' do
|
7
|
+
it 'renders as expected' do
|
8
|
+
render partial: 'pugin/components/status', locals: { status: nil }
|
9
|
+
|
10
|
+
expect(response).to eq(
|
11
|
+
<<DATA
|
12
|
+
<div class='highlight__status'>
|
13
|
+
<div class='c-fs status'>
|
14
|
+
<div class='c-fg'>
|
15
|
+
<div class='row--indent-horizontal'>
|
16
|
+
<p>This is a <a href="/"><strong>BETA</strong></a>. Give <a href="https://ukparliament-self.achieveservice.com/en/AchieveForms/?form_uri=sandbox-publish://AF-Process-032e1b1d-958f-4402-9ab2-97a38ed9b899/AF-Stage9b7ecae8-0c85-4ee7-afda-b256cffe5f08/definition.json&redirectlink=%2F&cancelRedirectLink=%2F&category=AF-Category-48936b5c-9329-48c7-a0a5-563463aacadf">feedback</a> to improve it.</p>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
DATA
|
22
|
+
)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'with a status message' do
|
27
|
+
it 'renders as expected' do
|
28
|
+
render partial: 'pugin/components/status', locals: { status: "test" }
|
29
|
+
|
30
|
+
expect(rendered).to eq(
|
31
|
+
<<DATA
|
32
|
+
<div class='highlight__status'>
|
33
|
+
<div class='c-fs status__test'>
|
34
|
+
<div class='c-fg'>
|
35
|
+
<div class='row--indent-horizontal'>
|
36
|
+
<p>This is a <a href="/"><strong>BETA</strong></a>. Give <a href="https://ukparliament-self.achieveservice.com/en/AchieveForms/?form_uri=sandbox-publish://AF-Process-032e1b1d-958f-4402-9ab2-97a38ed9b899/AF-Stage9b7ecae8-0c85-4ee7-afda-b256cffe5f08/definition.json&redirectlink=%2F&cancelRedirectLink=%2F&category=AF-Category-48936b5c-9329-48c7-a0a5-563463aacadf">feedback</a> to improve it.</p>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
DATA
|
42
|
+
)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'haml'
|
3
|
+
|
4
|
+
describe 'pugin/layouts/pugin.html.haml', type: :view do
|
5
|
+
context 'with a fully implemented person' do
|
6
|
+
let(:person) { double('Grom::Node') }
|
7
|
+
|
8
|
+
before :each do
|
9
|
+
allow(person).to receive(:name).and_return('Jane Smith')
|
10
|
+
allow(person).to receive(:position).and_return('Minister for Tests')
|
11
|
+
allow(person).to receive(:id).and_return('123')
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'renders HAML without errors' do
|
15
|
+
render
|
16
|
+
|
17
|
+
expect(rendered).to include('<title>Parliamentary Digital Service</title>')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,336 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pugin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Matt Rayner
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-02-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: haml
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sqlite3
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec-rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.5'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.5'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: capybara
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.12'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.12'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: factory_girl_rails
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '4.8'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '4.8'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.12'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.12'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: coveralls
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.8'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.8'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0.47'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0.47'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: pry
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0.10'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0.10'
|
153
|
+
description: Pugin is a component-based pattern design library that holds all of the
|
154
|
+
reusable partials, styles and scripts for elements of UK Parliament microservices.
|
155
|
+
email:
|
156
|
+
- mattrayner1@gmail.com
|
157
|
+
executables: []
|
158
|
+
extensions: []
|
159
|
+
extra_rdoc_files: []
|
160
|
+
files:
|
161
|
+
- LICENSE
|
162
|
+
- README.md
|
163
|
+
- Rakefile
|
164
|
+
- app/assets/config/pugin_manifest.js
|
165
|
+
- app/assets/images/pugin/favicon.ico
|
166
|
+
- app/assets/images/pugin/parliament-uk--darkgrey.png
|
167
|
+
- app/assets/images/pugin/parliament-uk--darkgrey.svg
|
168
|
+
- app/assets/images/pugin/parliament-uk--white-25.png
|
169
|
+
- app/assets/images/pugin/parliament-uk--white-25.svg
|
170
|
+
- app/assets/images/pugin/parliament-uk--white-50.png
|
171
|
+
- app/assets/images/pugin/parliament-uk--white-50.svg
|
172
|
+
- app/assets/images/pugin/parliament-uk-portcullis-black.png
|
173
|
+
- app/assets/images/pugin/parliament-uk-portcullis-black.svg
|
174
|
+
- app/assets/images/pugin/sprites-arrows.png
|
175
|
+
- app/assets/images/pugin/sprites-arrows.svg
|
176
|
+
- app/assets/javascripts/pugin/compiled/main.js
|
177
|
+
- app/assets/javascripts/pugin/pugin.js
|
178
|
+
- app/assets/stylesheets/pugin/compiled/main.css
|
179
|
+
- app/assets/stylesheets/pugin/overrides/asset_overrides.css.erb
|
180
|
+
- app/assets/stylesheets/pugin/pugin.css
|
181
|
+
- app/views/pugin/cards/_person-list.html.haml
|
182
|
+
- app/views/pugin/components/_footer.html.haml
|
183
|
+
- app/views/pugin/components/_header.html.haml
|
184
|
+
- app/views/pugin/components/_status.html.haml
|
185
|
+
- app/views/pugin/javascript/_google_tag_manager.html.haml
|
186
|
+
- app/views/pugin/javascript/_google_tag_manager_noscript.html.haml
|
187
|
+
- app/views/pugin/layouts/pugin.html.haml
|
188
|
+
- config/application.rb
|
189
|
+
- config/routes.rb
|
190
|
+
- lib/pugin.rb
|
191
|
+
- lib/pugin/engine.rb
|
192
|
+
- lib/pugin/version.rb
|
193
|
+
- lib/tasks/pugin_tasks.rake
|
194
|
+
- spec/dummy/Rakefile
|
195
|
+
- spec/dummy/app/assets/config/manifest.js
|
196
|
+
- spec/dummy/app/assets/javascripts/application.js
|
197
|
+
- spec/dummy/app/assets/javascripts/cable.js
|
198
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
199
|
+
- spec/dummy/app/channels/application_cable/channel.rb
|
200
|
+
- spec/dummy/app/channels/application_cable/connection.rb
|
201
|
+
- spec/dummy/app/controllers/application_controller.rb
|
202
|
+
- spec/dummy/app/helpers/application_helper.rb
|
203
|
+
- spec/dummy/app/jobs/application_job.rb
|
204
|
+
- spec/dummy/app/mailers/application_mailer.rb
|
205
|
+
- spec/dummy/app/models/application_record.rb
|
206
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
207
|
+
- spec/dummy/app/views/layouts/mailer.html.erb
|
208
|
+
- spec/dummy/app/views/layouts/mailer.text.erb
|
209
|
+
- spec/dummy/bin/bundle
|
210
|
+
- spec/dummy/bin/rails
|
211
|
+
- spec/dummy/bin/rake
|
212
|
+
- spec/dummy/bin/setup
|
213
|
+
- spec/dummy/bin/update
|
214
|
+
- spec/dummy/config.ru
|
215
|
+
- spec/dummy/config/application.rb
|
216
|
+
- spec/dummy/config/boot.rb
|
217
|
+
- spec/dummy/config/cable.yml
|
218
|
+
- spec/dummy/config/database.yml
|
219
|
+
- spec/dummy/config/environment.rb
|
220
|
+
- spec/dummy/config/environments/development.rb
|
221
|
+
- spec/dummy/config/environments/production.rb
|
222
|
+
- spec/dummy/config/environments/test.rb
|
223
|
+
- spec/dummy/config/initializers/application_controller_renderer.rb
|
224
|
+
- spec/dummy/config/initializers/assets.rb
|
225
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
226
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
227
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
228
|
+
- spec/dummy/config/initializers/inflections.rb
|
229
|
+
- spec/dummy/config/initializers/mime_types.rb
|
230
|
+
- spec/dummy/config/initializers/new_framework_defaults.rb
|
231
|
+
- spec/dummy/config/initializers/session_store.rb
|
232
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
233
|
+
- spec/dummy/config/locales/en.yml
|
234
|
+
- spec/dummy/config/puma.rb
|
235
|
+
- spec/dummy/config/routes.rb
|
236
|
+
- spec/dummy/config/secrets.yml
|
237
|
+
- spec/dummy/config/spring.rb
|
238
|
+
- spec/dummy/db/schema.rb
|
239
|
+
- spec/dummy/public/404.html
|
240
|
+
- spec/dummy/public/422.html
|
241
|
+
- spec/dummy/public/500.html
|
242
|
+
- spec/dummy/public/apple-touch-icon-precomposed.png
|
243
|
+
- spec/dummy/public/apple-touch-icon.png
|
244
|
+
- spec/dummy/public/favicon.ico
|
245
|
+
- spec/pugin/engine_spec.rb
|
246
|
+
- spec/pugin_spec.rb
|
247
|
+
- spec/spec_helper.rb
|
248
|
+
- spec/views/pugin/cards/_person-list.html.haml_spec.rb
|
249
|
+
- spec/views/pugin/components/_footer.html.haml_spec.rb
|
250
|
+
- spec/views/pugin/components/_header.html.haml_spec.rb
|
251
|
+
- spec/views/pugin/components/_status.html.haml_spec.rb
|
252
|
+
- spec/views/pugin/layouts/pugin.html.haml_spec.rb
|
253
|
+
homepage: https://github.com/ukparliament/pugin
|
254
|
+
licenses:
|
255
|
+
- Nonstandard
|
256
|
+
metadata: {}
|
257
|
+
post_install_message:
|
258
|
+
rdoc_options: []
|
259
|
+
require_paths:
|
260
|
+
- lib
|
261
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
262
|
+
requirements:
|
263
|
+
- - ">="
|
264
|
+
- !ruby/object:Gem::Version
|
265
|
+
version: '0'
|
266
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
267
|
+
requirements:
|
268
|
+
- - ">="
|
269
|
+
- !ruby/object:Gem::Version
|
270
|
+
version: '0'
|
271
|
+
requirements: []
|
272
|
+
rubyforge_project:
|
273
|
+
rubygems_version: 2.6.10
|
274
|
+
signing_key:
|
275
|
+
specification_version: 4
|
276
|
+
summary: Pugin is a component-based pattern design library for UK Parliament microservices.
|
277
|
+
test_files:
|
278
|
+
- spec/dummy/app/assets/config/manifest.js
|
279
|
+
- spec/dummy/app/assets/javascripts/application.js
|
280
|
+
- spec/dummy/app/assets/javascripts/cable.js
|
281
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
282
|
+
- spec/dummy/app/channels/application_cable/channel.rb
|
283
|
+
- spec/dummy/app/channels/application_cable/connection.rb
|
284
|
+
- spec/dummy/app/controllers/application_controller.rb
|
285
|
+
- spec/dummy/app/helpers/application_helper.rb
|
286
|
+
- spec/dummy/app/jobs/application_job.rb
|
287
|
+
- spec/dummy/app/mailers/application_mailer.rb
|
288
|
+
- spec/dummy/app/models/application_record.rb
|
289
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
290
|
+
- spec/dummy/app/views/layouts/mailer.html.erb
|
291
|
+
- spec/dummy/app/views/layouts/mailer.text.erb
|
292
|
+
- spec/dummy/bin/bundle
|
293
|
+
- spec/dummy/bin/rails
|
294
|
+
- spec/dummy/bin/rake
|
295
|
+
- spec/dummy/bin/setup
|
296
|
+
- spec/dummy/bin/update
|
297
|
+
- spec/dummy/config/application.rb
|
298
|
+
- spec/dummy/config/boot.rb
|
299
|
+
- spec/dummy/config/cable.yml
|
300
|
+
- spec/dummy/config/database.yml
|
301
|
+
- spec/dummy/config/environment.rb
|
302
|
+
- spec/dummy/config/environments/development.rb
|
303
|
+
- spec/dummy/config/environments/production.rb
|
304
|
+
- spec/dummy/config/environments/test.rb
|
305
|
+
- spec/dummy/config/initializers/application_controller_renderer.rb
|
306
|
+
- spec/dummy/config/initializers/assets.rb
|
307
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
308
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
309
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
310
|
+
- spec/dummy/config/initializers/inflections.rb
|
311
|
+
- spec/dummy/config/initializers/mime_types.rb
|
312
|
+
- spec/dummy/config/initializers/new_framework_defaults.rb
|
313
|
+
- spec/dummy/config/initializers/session_store.rb
|
314
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
315
|
+
- spec/dummy/config/locales/en.yml
|
316
|
+
- spec/dummy/config/puma.rb
|
317
|
+
- spec/dummy/config/routes.rb
|
318
|
+
- spec/dummy/config/secrets.yml
|
319
|
+
- spec/dummy/config/spring.rb
|
320
|
+
- spec/dummy/config.ru
|
321
|
+
- spec/dummy/db/schema.rb
|
322
|
+
- spec/dummy/public/404.html
|
323
|
+
- spec/dummy/public/422.html
|
324
|
+
- spec/dummy/public/500.html
|
325
|
+
- spec/dummy/public/apple-touch-icon-precomposed.png
|
326
|
+
- spec/dummy/public/apple-touch-icon.png
|
327
|
+
- spec/dummy/public/favicon.ico
|
328
|
+
- spec/dummy/Rakefile
|
329
|
+
- spec/pugin/engine_spec.rb
|
330
|
+
- spec/pugin_spec.rb
|
331
|
+
- spec/spec_helper.rb
|
332
|
+
- spec/views/pugin/cards/_person-list.html.haml_spec.rb
|
333
|
+
- spec/views/pugin/components/_footer.html.haml_spec.rb
|
334
|
+
- spec/views/pugin/components/_header.html.haml_spec.rb
|
335
|
+
- spec/views/pugin/components/_status.html.haml_spec.rb
|
336
|
+
- spec/views/pugin/layouts/pugin.html.haml_spec.rb
|