pugin 1.6.1 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 259303eb81965bae622a9971052d92e96bd4b3a6
4
- data.tar.gz: 7bdcda8a14b878b8d6a5d73e8fd7698e2ac65a56
3
+ metadata.gz: db65a3038af4b286b56e3a3c703bd546aedb00b5
4
+ data.tar.gz: 8ea7bfb273301fb92b98fb4d8a21c3db85efa09e
5
5
  SHA512:
6
- metadata.gz: d8421e31c9923d5ad4348cd92397cacdd05da6dff2797b1768e043281dc240772503092f968792cc25254ba0c9dfcbbd1e39fc8b8af983e01caad0e2a42cc320
7
- data.tar.gz: 5989219a43c3b68ccc1cdff33e30ca8d148544a500896f127455f58e73cab2156b22b0dc8e2317c3ec9ae3e131da7f75aab9cd3578604203156e3b78ffd60020
6
+ metadata.gz: 6c7b14a7c08bd6634705f888521490c9676aa55d60edf21f988abb1a824ea2d0702587d6a39bf0d8406b84f9b74d2fcb5bdf73bb63275a6412c8082e82b6085f
7
+ data.tar.gz: 0b124f735acbfcd8f9d0d4c8c5fdde974b94c573ba386e5b0451bad1a2911d08865e333f21ac83f1961347248541dc159648f1d596ec4d98a389c58fb7df9ee2
@@ -6,7 +6,7 @@
6
6
  - if lord.image_id != "placeholder"
7
7
  %img{ src: "#{ENV['IMAGE_SERVICE_URL']}/#{lord.image_id}.jpeg?crop=CU_1:1&width=186&quality=80", alt: "#{lord.display_name}" }
8
8
  - else
9
- %img{ src: "#{Pugin::ASSET_LOCATION_URL}/#{Pugin::ASSET_VERSION}/images/placeholder_members_image.png", alt: "placeholder" }
9
+ %img{ src: "#{Pugin::ASSET_LOCATION_URL}/#{Pugin::ASSET_VERSION}/images/placeholder_members_image.png", alt: "" }
10
10
 
11
11
  .list--details
12
12
  - if !instance_variable_get("@parliament").nil? # parliament lord
@@ -7,7 +7,7 @@
7
7
  - if member.image_id != "placeholder"
8
8
  %img{ src: "#{ENV['IMAGE_SERVICE_URL']}/#{member.image_id}.jpeg?crop=CU_1:1&width=186&quality=80", alt: "#{member.display_name}" }
9
9
  - else
10
- %img{ src: "#{Pugin::ASSET_LOCATION_URL}/#{Pugin::ASSET_VERSION}/images/placeholder_members_image.png", alt: "placeholder" }
10
+ %img{ src: "#{Pugin::ASSET_LOCATION_URL}/#{Pugin::ASSET_VERSION}/images/placeholder_members_image.png", alt: "" }
11
11
 
12
12
  .list--details
13
13
  - if !instance_variable_get("@parliament").nil? # parliament member
data/lib/pugin.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'pugin/version'
2
2
 
3
3
  module Pugin
4
- ASSET_VERSION = '1.6.4'.freeze
4
+ ASSET_VERSION = '1.7.0'.freeze
5
5
  ASSET_LOCATION_URL = ENV.fetch('ASSET_LOCATION_URL', 'https://s3-eu-west-1.amazonaws.com/web1live.pugin-website')
6
6
  STATIC_ASSET_LOCATION_URL = ENV.fetch('STATIC_ASSET_LOCATION_URL', 'https://s3-eu-west-1.amazonaws.com/web1live.static-assets')
7
7
  class << self
@@ -37,8 +37,11 @@ module Pugin
37
37
 
38
38
  @features.fetch('show-government-roles', false)
39
39
  end
40
+ def show_opposition_roles?
41
+ get_features
40
42
 
41
-
43
+ @features.fetch('show-opposition-roles', false)
44
+ end
42
45
 
43
46
  # Reset cached features
44
47
  def reset
data/lib/pugin/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pugin
2
- VERSION = '1.6.1'.freeze
2
+ VERSION = '1.6.3'.freeze
3
3
  end
@@ -10,7 +10,8 @@ describe 'The bandiera client feature set' do
10
10
  'show-post-election': :post_election?,
11
11
  'show-list-images': :show_list_images?,
12
12
  'show-committees': :show_committees?,
13
- 'show-government-roles': :show_government_roles?
13
+ 'show-government-roles': :show_government_roles?,
14
+ 'show-opposition-roles': :show_opposition_roles?
14
15
  }
15
16
 
16
17
  method_hash.each do |flag_name, method_name|
@@ -14,21 +14,9 @@ describe 'pugin/components/_status.html.haml', type: :view do
14
14
  it 'renders a message not related to the dissolution' do
15
15
  render partial: 'pugin/components/status', locals: { status: nil }
16
16
 
17
- expect(response).to eq(
18
- <<DATA
19
- <div class='status--banner'>
20
- <div class='container'>
21
- <p>
22
- <img alt='' aria-hidden='true' aria-label='caution' class='icon--inline' src='https://s3-eu-west-1.amazonaws.com/web1live.pugin-website/1.6.4/icons/caution-circle-white.svg'>
23
- <span class='sr-only'>caution</span>
24
- This is a test website, so may be inaccurate.
25
- <a href='http://www.smartsurvey.co.uk/s/ukparliament-beta-website-feedback/'>Give feedback</a>
26
- to help improve it.
27
- </p>
28
- </div>
29
- </div>
30
- DATA
31
- )
17
+ expect(rendered).not_to include(I18n.t('pugin.components.status.election_text_1'))
18
+ expect(rendered).not_to include(I18n.t('pugin.components.status.election_text_3'))
19
+ expect(rendered).not_to include(I18n.t('pugin.components.status.how_to_vote'))
32
20
  end
33
21
  end
34
22
 
@@ -41,23 +29,8 @@ DATA
41
29
 
42
30
  it 'renders a message that shows a link to register to vote' do
43
31
  render partial: 'pugin/components/status', locals: { status: nil }
44
- expect(response).to eq(
45
- <<DATA
46
- <div class='status--banner'>
47
- <div class='container'>
48
- <p>
49
- <img alt='' aria-hidden='true' aria-label='caution' class='icon--inline' src='https://s3-eu-west-1.amazonaws.com/web1live.pugin-website/1.6.4/icons/caution-circle-white.svg'>
50
- <span class='sr-only'>caution</span>
51
- This is a test website, so may be inaccurate.
52
- <a href='http://www.smartsurvey.co.uk/s/ukparliament-beta-website-feedback/'>Give feedback</a>
53
- to help improve it.
54
- <a href='https://www.gov.uk/register-to-vote'>Register to vote</a>
55
- in the general election by 22 May.
56
- </p>
57
- </div>
58
- </div>
59
- DATA
60
- )
32
+
33
+ expect(rendered).to include("<a href='https://www.gov.uk/register-to-vote'>Register to vote</a>")
61
34
  end
62
35
  end
63
36
 
@@ -71,24 +44,7 @@ DATA
71
44
  it 'renders a message that reminds the user of the general election date' do
72
45
  render partial: 'pugin/components/status', locals: { status: nil }
73
46
 
74
- expect(response).to eq(
75
- <<DATA
76
- <div class='status--banner'>
77
- <div class='container'>
78
- <p>
79
- <img alt='' aria-hidden='true' aria-label='caution' class='icon--inline' src='https://s3-eu-west-1.amazonaws.com/web1live.pugin-website/1.6.4/icons/caution-circle-white.svg'>
80
- <span class='sr-only'>caution</span>
81
- This is a test website, so may be inaccurate.
82
- <a href='http://www.smartsurvey.co.uk/s/ukparliament-beta-website-feedback/'>Give feedback</a>
83
- to help improve it.
84
- Find out
85
- <a href='http://www.parliament.uk/get-involved/elections/voting/'>how to vote</a>
86
- in the general election on 8 June.
87
- </p>
88
- </div>
89
- </div>
90
- DATA
91
- )
47
+ expect(rendered).to include(I18n.t('pugin.components.status.election_text_2'))
92
48
  end
93
49
  end
94
50
 
@@ -103,23 +59,7 @@ DATA
103
59
  it 'renders a message that reminds the user of the general election date' do
104
60
  render partial: 'pugin/components/status', locals: { status: nil }
105
61
 
106
- expect(response).to eq(
107
- <<DATA
108
- <div class='status--banner'>
109
- <div class='container'>
110
- <p>
111
- <img alt='' aria-hidden='true' aria-label='caution' class='icon--inline' src='https://s3-eu-west-1.amazonaws.com/web1live.pugin-website/1.6.4/icons/caution-circle-white.svg'>
112
- <span class='sr-only'>caution</span>
113
- This is a test website, so may be inaccurate.
114
- <a href='http://www.smartsurvey.co.uk/s/ukparliament-beta-website-feedback/'>Give feedback</a>
115
- to help improve it.
116
- Thursday 8 June is election day, find out
117
- <a href='http://www.parliament.uk/get-involved/elections/voting/'>how to vote</a>.
118
- </p>
119
- </div>
120
- </div>
121
- DATA
122
- )
62
+ expect(rendered).to include(I18n.t('pugin.components.status.election_day_text'))
123
63
  end
124
64
  end
125
65
 
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: 1.6.1
4
+ version: 1.6.3
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-11-14 00:00:00.000000000 Z
11
+ date: 2017-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails