ama_layout 9.5.3 → 10.0.1

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
- SHA1:
3
- metadata.gz: c1438c7c2749a5dc0f2d4e5387f2aed0d407d469
4
- data.tar.gz: 5298227383c4eaf41b4d2d95f0a6727c58aef6f6
2
+ SHA256:
3
+ metadata.gz: a5cc2556c75c0b6a580dedc33539dcf01534af0cb208b4a75d54d6348e815192
4
+ data.tar.gz: 02b4d128b39f8fb3707ee56e23137a89efea094c2d2e875bd78e44c1de5700b5
5
5
  SHA512:
6
- metadata.gz: 147b7d57cd1f37b129989dc4858cc98dba9bd57ee63da078887713207d41e90416bfc8d379507aec7a6c1f559bd313659a8d938fdc7161aceec3e977853578e1
7
- data.tar.gz: daa69645e968279e9596488b8cff9d29f8d363558a2f021c015aaf5a38e97d50c8001d7d616f967463fc6f80671afbe38e7fdafd6ac173b131da9763c9dbf383
6
+ metadata.gz: 6e949fba8e7c225ebf56c7ce4eed1e452b6c3344efee0514cdbcbc50cf23ef58d28afc10ba508fe09f7642cad0b36459cabb9869e7534d9410c9fecbdb5fc144
7
+ data.tar.gz: 4300592222f3ec0098f0c08d112be3999dbd276455c531588f43fd515a94cdeb6c7edab05ae028abed28092776adef624af3ccdd8a8859473f07ca4e2295fec9
@@ -0,0 +1 @@
1
+ 2.5.5
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.2
3
+ - 2.5.5
4
4
  sudo: false
5
5
  services:
6
6
  - redis-server
@@ -1,35 +1,50 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'ama_layout/version'
5
6
 
6
7
  Gem::Specification.new do |spec|
7
- spec.name = 'ama_layout'
8
- spec.version = AmaLayout::VERSION
9
- spec.authors = ['Michael van den Beuken', 'Ruben Estevez', 'Jordan Babe', 'Mathieu Gilbert', 'Ryan Jones', 'Darko Dosenovic', 'Jonathan Weyermann', 'Adam Melnyk', 'Kayt Campbell', 'Kathleen Robertson', 'Jesse Doyle']
10
- spec.email = ['michael.beuken@gmail.com', 'ruben.a.estevez@gmail.com', 'jorbabe@gmail.com', 'mathieu.gilbert@ama.ab.ca', 'ryan.michael.jones@gmail.com', 'darko.dosenovic@ama.ab.ca', 'jonathan.weyermann@ama.ab.ca', 'adam.melnyk@ama.ab.ca', 'kayt.campbell@ama.ab.ca', 'kathleen.robertson@ama.ab.ca', 'jesse.doyle@ama.ab.ca']
11
- spec.summary = %q{.ama.ab.ca site layouts}
12
- spec.description = %q{.ama.ab.ca site layouts}
13
- spec.homepage = 'https://github.com/amaabca/ama_layout'
14
- spec.license = 'MIT'
8
+ spec.name = 'ama_layout'
9
+ spec.version = AmaLayout::VERSION
10
+ spec.authors = [
11
+ 'Darko Dosenovic',
12
+ 'Jesse Doyle',
13
+ 'Kayt Wilson',
14
+ 'Michael van den Beuken',
15
+ 'Sinead Errity',
16
+ 'Zoie Carnegie'
17
+ ]
18
+ spec.email = [
19
+ 'darko.dosenovic@ama.ab.ca',
20
+ 'jesse.doyle@ama.ab.ca',
21
+ 'kayt.wilson@ama.ab.ca',
22
+ 'michael.beuken@gmail.com',
23
+ 'sinead.errity@ama.ab.ca',
24
+ 'zoie.carnegie@ama.ab.ca'
25
+ ]
26
+ spec.summary = '.ama.ab.ca site layouts'
27
+ spec.description = '.ama.ab.ca site layouts'
28
+ spec.homepage = 'https://github.com/amaabca/ama_layout'
29
+ spec.license = 'MIT'
15
30
 
16
- spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
31
+ spec.files = `git ls-files -z`.split("\x0")
32
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
33
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
34
  spec.require_paths = ['lib']
20
35
 
36
+ spec.add_dependency 'breadcrumbs_on_rails', '>= 3'
37
+ spec.add_dependency 'browser', '~> 2.0'
21
38
  spec.add_dependency 'foundation-rails', '<= 6.4.3.0'
22
39
  spec.add_dependency 'rails', '>= 4.2'
23
- spec.add_dependency 'browser', '~> 2.0'
24
- spec.add_dependency 'breadcrumbs_on_rails', '>= 3'
25
40
  spec.add_dependency 'redis-rails'
26
- spec.add_development_dependency 'bundler', '~> 1.11'
41
+ spec.add_development_dependency 'bundler', '~> 1.17.3'
42
+ spec.add_development_dependency 'combustion'
43
+ spec.add_development_dependency 'factory_bot'
44
+ spec.add_development_dependency 'pry'
27
45
  spec.add_development_dependency 'rake', '>= 11.0'
28
46
  spec.add_development_dependency 'rspec-rails'
29
- spec.add_development_dependency 'factory_bot'
30
47
  spec.add_development_dependency 'simplecov'
31
- spec.add_development_dependency 'pry'
32
- spec.add_development_dependency 'combustion'
33
48
  spec.add_development_dependency 'sqlite3'
34
49
  spec.add_development_dependency 'timecop'
35
50
  end
@@ -0,0 +1,3 @@
1
+ <li class="small-text">
2
+ <%= link_to 'Manage Credit Cards', "#{Rails.configuration.gatekeeper_site}/members/credit_cards" %>
3
+ </li>
@@ -1,11 +1,19 @@
1
1
  <li class="has-submenu">
2
2
  <%= link_to navigation.display_name_text, '#', class: 'link--no-underline' %>
3
3
  <ul class="submenu menu vertical">
4
- <li>
5
- <%= link_to 'Online Account', Rails.configuration.gatekeeper_site %>
4
+ <li class="bold">
5
+ <%= link_to 'Account Settings', "#{Rails.configuration.gatekeeper_site}/user/edit" %>
6
6
  </li>
7
- <li><%= link_to 'AMA Website', Rails.configuration.amaabca_site %></li>
8
- <li><a href="http://amaroadreports.ca/">AMA Road Reports</a></li>
7
+ <li class="small-text">
8
+ <%= link_to 'Change Email/Password', "#{Rails.configuration.gatekeeper_site}/user/edit" %>
9
+ </li>
10
+ <li class="small-text">
11
+ <%= link_to 'Email Subscriptions', "#{Rails.configuration.youraccount_site}/subscriptions" %>
12
+ </li>
13
+ <li class="small-text">
14
+ <%= link_to 'Update Address', "#{Rails.configuration.youraccount_site}/membership_update/new" %>
15
+ </li>
16
+ <%= navigation.manage_credit_card_link %>
9
17
  <%= navigation.sign_out_link %>
10
18
  </ul>
11
19
  </li>
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rubygems"
4
+ require "bundler"
5
+
6
+ Bundler.require :default, :development
7
+
8
+ Combustion.initialize! :all
9
+ run Combustion::Application
@@ -12,18 +12,21 @@ module AmaLayout
12
12
  end
13
13
 
14
14
  def sign_out_link
15
- return "" unless user
16
- h.render partial: "ama_layout/sign_out_link"
15
+ return '' unless user
16
+
17
+ h.render partial: 'ama_layout/sign_out_link'
17
18
  end
18
19
 
19
20
  def top_nav
20
- return "" unless user
21
- h.render partial: "ama_layout/agent/top_nav", locals: { navigation: self }
21
+ return '' unless user
22
+
23
+ h.render partial: 'ama_layout/agent/top_nav', locals: { navigation: self }
22
24
  end
23
25
 
24
26
  def sidebar
25
- return "" unless user
26
- h.render partial: "ama_layout/sidebar", locals: { navigation: self }
27
+ return '' unless user
28
+
29
+ h.render partial: 'ama_layout/sidebar', locals: { navigation: self }
27
30
  end
28
31
 
29
32
  def cash_drawer_name
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module AmaLayout
2
4
  class NavigationDecorator
3
5
  include AmaLayout::DraperReplacement
@@ -11,16 +13,27 @@ module AmaLayout
11
13
  end
12
14
 
13
15
  def sign_out_link
14
- return "" unless user
15
- h.render partial: "ama_layout/sign_out_link"
16
+ return '' unless user
17
+
18
+ h.render partial: 'ama_layout/sign_out_link'
19
+ end
20
+
21
+ def manage_credit_card_link
22
+ return '' unless user && %w[member member_renewal member_outstanding_balance].include?(user.try(:menu_key))
23
+
24
+ h.render partial: 'ama_layout/manage_credit_card_link'
16
25
  end
17
26
 
18
27
  def top_nav
19
- h.render partial: "ama_layout/top_nav", locals: { navigation: self } if user
28
+ return '' unless user
29
+
30
+ h.render partial: 'ama_layout/top_nav', locals: { navigation: self }
20
31
  end
21
32
 
22
33
  def sidebar
23
- h.render partial: "ama_layout/sidebar", locals: { navigation: self } if items.any?
34
+ return '' if items.none?
35
+
36
+ h.render partial: 'ama_layout/sidebar', locals: { navigation: self }
24
37
  end
25
38
 
26
39
  def name_or_email
@@ -28,42 +41,44 @@ module AmaLayout
28
41
  end
29
42
 
30
43
  def account_toggle(view_data = {})
31
- h(view_data).render partial: "account_toggle"
44
+ h(view_data).render partial: 'account_toggle'
32
45
  end
33
46
 
34
47
  def notification_icon
35
- if user
36
- h.render 'ama_layout/notification_icon', navigation: self
37
- end
48
+ return '' unless user
49
+
50
+ h.render 'ama_layout/notification_icon', navigation: self
38
51
  end
39
52
 
40
53
  def mobile_notification_icon
41
- if user
42
- h.render 'ama_layout/mobile_notification_icon', navigation: self
43
- end
54
+ return '' unless user
55
+
56
+ h.render 'ama_layout/mobile_notification_icon', navigation: self
44
57
  end
45
58
 
46
59
  def mobile_links
47
- h.render 'ama_layout/mobile_links' unless user
60
+ return '' if user
61
+
62
+ h.render 'ama_layout/mobile_links'
48
63
  end
49
64
 
50
65
  def notification_badge
51
- if new_notifications?
52
- h.content_tag(
53
- :div,
54
- active_notification_count,
55
- class: 'notification__badge',
56
- data: {
57
- notification_count: true
58
- }
59
- )
60
- end
66
+ return '' unless new_notifications?
67
+
68
+ h.content_tag(
69
+ :div,
70
+ active_notification_count,
71
+ class: 'notification__badge',
72
+ data: {
73
+ notification_count: true
74
+ }
75
+ )
61
76
  end
62
77
 
63
78
  def notification_sidebar
64
- if user
65
- h.render 'ama_layout/notification_sidebar', navigation: self, notifications: decorated_notifications
66
- end
79
+ return '' unless user
80
+
81
+ h.render 'ama_layout/notification_sidebar', navigation: self, notifications: decorated_notifications
67
82
  end
68
83
 
69
84
  def notifications_heading
@@ -85,7 +100,7 @@ module AmaLayout
85
100
  end
86
101
 
87
102
  def new_notifications?
88
- active_notification_count > 0
103
+ active_notification_count.positive?
89
104
  end
90
105
  end
91
106
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module AmaLayout
2
4
  class Navigation
3
5
  include ActiveModel::Model
@@ -14,44 +16,49 @@ module AmaLayout
14
16
  end
15
17
 
16
18
  cattr_accessor :member do
17
- "member"
19
+ 'member'
18
20
  end
19
21
 
20
22
  cattr_accessor :non_member do
21
- "non-member"
23
+ 'non-member'
22
24
  end
23
25
 
24
26
  cattr_accessor :member_in_renewal do
25
- "member-in-renewal"
27
+ 'member-in-renewal'
26
28
  end
27
29
 
28
30
  cattr_accessor :member_in_renewal_late do
29
- "member-in-renewal-late"
31
+ 'member-in-renewal-late'
30
32
  end
31
33
 
32
34
  cattr_accessor :member_with_outstanding_balance do
33
- "member-with-outstanding-balance"
35
+ 'member-with-outstanding-balance'
34
36
  end
35
37
 
36
38
  def items
37
39
  navigation_items.fetch(user.try(:navigation), []).map do |n|
38
- NavigationItem.new n.merge({ current_url: current_url})
40
+ NavigationItem.new n.merge(current_url: current_url)
39
41
  end
40
42
  end
41
43
 
42
44
  def navigation_items
43
- YAML.load ERB.new(File.read nav_file_path).result
45
+ YAML.safe_load(ERB.new(File.read(nav_file_path)).result)
44
46
  end
45
47
 
46
48
  def email
47
49
  user.email
48
50
  end
49
51
 
50
- private
52
+ private
51
53
 
52
54
  def defaults
53
55
  {
54
- nav_file_path: File.join(Gem.loaded_specs["ama_layout"].full_gem_path, "lib", "ama_layout", "navigation.yml")
56
+ nav_file_path: File.join(
57
+ Gem.loaded_specs['ama_layout'].full_gem_path,
58
+ 'lib',
59
+ 'ama_layout',
60
+ 'navigation.yml'
61
+ )
55
62
  }
56
63
  end
57
64
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module AmaLayout
2
- VERSION = '9.5.3'
4
+ VERSION = '10.0.1'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  describe AmaLayout::NavigationDecorator do
2
4
  let(:navigation) { FactoryBot.build(:navigation) }
3
5
  let(:navigation_presenter) { navigation.decorate }
@@ -15,53 +17,53 @@ describe AmaLayout::NavigationDecorator do
15
17
  Rails.configuration.amaabca_site = 'http://test.ama.ab.ca/'
16
18
  end
17
19
 
18
- describe "#display_name_text" do
20
+ describe '#display_name_text' do
19
21
  let(:user) { OpenStruct.new(email: 'john.doe@test.com') }
20
22
 
21
- context "name is provided" do
22
- let(:name) { "John D" }
23
+ context 'name is provided' do
24
+ let(:name) { 'John D' }
23
25
  let(:nav) { AmaLayout::Navigation.new(user: user, display_name: name).decorate }
24
26
 
25
- it "has a welcome message" do
26
- expect(nav.display_name_text).to eq "Welcome, John D"
27
+ it 'has a welcome message' do
28
+ expect(nav.display_name_text).to eq('Welcome, John D')
27
29
  end
28
30
 
29
- context "long name given" do
30
- let(:name) { "A Really Really Really Really Long Name" }
31
+ context 'long name given' do
32
+ let(:name) { 'A Really Really Really Really Long Name' }
31
33
 
32
- it "trucates to a total of 30 characters" do
33
- expect(nav.display_name_text).to eq "Welcome, #{name.titleize}".truncate(30)
34
+ it 'trucates to a total of 30 characters' do
35
+ expect(nav.display_name_text).to eq("Welcome, #{name.titleize}".truncate(30))
34
36
  end
35
37
  end
36
38
  end
37
39
 
38
- context "name is not provided" do
40
+ context 'name is not provided' do
39
41
  let(:nav) { AmaLayout::Navigation.new(user: user).decorate }
40
42
 
41
- it "returns the user's email address" do
42
- expect(nav.display_name_text).to eq user.email
43
+ it 'returns the email address' do
44
+ expect(nav.display_name_text).to eq(user.email)
43
45
  end
44
46
 
45
- context "a really long email" do
47
+ context 'a really long email' do
46
48
  let(:user) { OpenStruct.new(email: 'areallyreallyreallylongemail@test.com') }
47
49
 
48
- it "trucates to a total of 30 characters" do
49
- expect(nav.display_name_text).to eq user.email.truncate(30)
50
+ it 'trucates to a total of 30 characters' do
51
+ expect(nav.display_name_text).to eq(user.email.truncate(30))
50
52
  end
51
53
  end
52
54
  end
53
55
  end
54
56
 
55
- describe "#items" do
57
+ describe '#items' do
56
58
  before(:each) do
57
- allow_any_instance_of(AmaLayout::Navigation).to receive(:user).and_return(OpenStruct.new(navigation: "member"))
59
+ allow_any_instance_of(AmaLayout::Navigation).to receive(:user).and_return(OpenStruct.new(navigation: 'member'))
58
60
  end
59
61
 
60
- it "returns an array of navigation items" do
62
+ it 'returns an array of navigation items' do
61
63
  expect(navigation_presenter.items).to be_an Array
62
64
  end
63
65
 
64
- it "array contains decorated navigation items" do
66
+ it 'array contains decorated navigation items' do
65
67
  items = navigation_presenter.items
66
68
  items.each do |i|
67
69
  expect(i).to be_a AmaLayout::NavigationItemDecorator
@@ -76,7 +78,7 @@ describe AmaLayout::NavigationDecorator do
76
78
  end
77
79
 
78
80
  it 'returns nil' do
79
- expect(navigation_presenter.mobile_links).to be_nil
81
+ expect(navigation_presenter.mobile_links).to eq('')
80
82
  end
81
83
  end
82
84
 
@@ -87,71 +89,123 @@ describe AmaLayout::NavigationDecorator do
87
89
  end
88
90
  end
89
91
 
90
- describe "#sign_out_link" do
91
- context "with user" do
92
- it "returns link" do
93
- allow_any_instance_of(AmaLayout::Navigation).to receive(:user).and_return(OpenStruct.new(navigation: "member"))
94
- expect(navigation_presenter.sign_out_link).to include "Sign Out"
92
+ describe '#sign_out_link' do
93
+ context 'with user' do
94
+ it 'returns link' do
95
+ allow_any_instance_of(AmaLayout::Navigation).to receive(:user).and_return(OpenStruct.new(navigation: 'member'))
96
+ expect(navigation_presenter.sign_out_link).to include('Sign Out')
95
97
  end
96
98
  end
97
99
 
98
- context "without user" do
99
- it "does not return the link" do
100
- expect(navigation_presenter.sign_out_link).to eq ""
100
+ context 'without user' do
101
+ it 'does not return the link' do
102
+ expect(navigation_presenter.sign_out_link).to eq('')
101
103
  end
102
104
  end
103
105
  end
104
106
 
105
- describe "#top_nav" do
106
- context "with items" do
107
- it "renders the partial" do
108
- allow_any_instance_of(AmaLayout::Navigation).to receive(:user).and_return(OpenStruct.new(navigation: "member"))
109
- allow_any_instance_of(AmaLayout::AmaLayoutView).to receive(:render).and_return "render"
110
- expect(navigation_presenter.top_nav).to eq "render"
107
+ describe '#top_nav' do
108
+ context 'with items' do
109
+ it 'renders the partial' do
110
+ allow_any_instance_of(AmaLayout::Navigation).to receive(:user).and_return(OpenStruct.new(navigation: 'member'))
111
+ allow_any_instance_of(AmaLayout::AmaLayoutView).to receive(:render).and_return 'render'
112
+ expect(navigation_presenter.top_nav).to eq('render')
111
113
  end
112
114
  end
113
115
 
114
- context "without items" do
115
- it "does not renders the partial" do
116
- expect(navigation_presenter.top_nav).to eq nil
116
+ context 'without items' do
117
+ it 'does not renders the partial' do
118
+ expect(navigation_presenter.top_nav).to eq('')
117
119
  end
118
120
  end
119
121
  end
120
122
 
121
- describe "#sidebar" do
122
- context "with items" do
123
- it "renders the partial" do
124
- allow_any_instance_of(AmaLayout::Navigation).to receive(:user).and_return(OpenStruct.new(navigation: "member"))
125
- allow_any_instance_of(AmaLayout::AmaLayoutView).to receive(:render).and_return "render"
126
- expect(navigation_presenter.sidebar).to eq "render"
123
+ describe '#sidebar' do
124
+ context 'with items' do
125
+ it 'renders the partial' do
126
+ allow_any_instance_of(AmaLayout::Navigation).to receive(:user).and_return(OpenStruct.new(navigation: 'member'))
127
+ allow_any_instance_of(AmaLayout::AmaLayoutView).to receive(:render).and_return 'render'
128
+ expect(navigation_presenter.sidebar).to eq('render')
129
+ end
130
+ end
131
+
132
+ context 'without items' do
133
+ it 'does not renders the partial' do
134
+ expect(navigation_presenter.sidebar).to eq('')
127
135
  end
128
136
  end
137
+ end
138
+
139
+ describe '#manage_credit_card_link' do
140
+ let(:navigation) { FactoryBot.build(:navigation, user: user) }
141
+
142
+ context 'nil user' do
143
+ let(:user) {}
144
+
145
+ it 'returns nothing' do
146
+ expect(navigation_presenter.manage_credit_card_link).to eq('')
147
+ end
148
+ end
149
+
150
+ context 'non_member' do
151
+ let(:user) { FactoryBot.build(:user, :non_member) }
152
+
153
+ it 'returns nothing' do
154
+ expect(navigation_presenter.manage_credit_card_link).to eq('')
155
+ end
156
+ end
157
+
158
+ context 'status AL' do
159
+ let(:user) { FactoryBot.build(:user, :in_renewal_late) }
160
+
161
+ it 'returns nothing' do
162
+ expect(navigation_presenter.manage_credit_card_link).to eq('')
163
+ end
164
+ end
165
+
166
+ context 'outstanding balance' do
167
+ let(:user) { FactoryBot.build(:user, :outstanding_balance) }
168
+
169
+ it 'returns the manage credit cards link' do
170
+ expect(navigation_presenter.manage_credit_card_link).to include('Manage Credit Cards')
171
+ end
172
+ end
173
+
174
+ context 'member' do
175
+ let(:user) { FactoryBot.build(:user) }
176
+
177
+ it 'returns the manage credit cards link' do
178
+ expect(navigation_presenter.manage_credit_card_link).to include('Manage Credit Cards')
179
+ end
180
+ end
181
+
182
+ context 'in renewal' do
183
+ let(:user) { FactoryBot.build(:user, :in_renewal) }
129
184
 
130
- context "without items" do
131
- it "does not renders the partial" do
132
- expect(navigation_presenter.sidebar).to eq nil
185
+ it 'returns the manage credit cards link' do
186
+ expect(navigation_presenter.manage_credit_card_link).to include('Manage Credit Cards')
133
187
  end
134
188
  end
135
189
  end
136
190
 
137
- context "account toggle" do
138
- it "in ama_layout it renders a blank partial" do
139
- allow_any_instance_of(AmaLayout::Navigation).to receive(:user).and_return(OpenStruct.new(navigation: "member"))
140
- allow_any_instance_of(AmaLayout::AmaLayoutView).to receive(:render).and_return "render"
141
- expect(navigation_presenter.account_toggle).to eq "render"
191
+ context 'account toggle' do
192
+ it 'in ama_layout it renders a blank partial' do
193
+ allow_any_instance_of(AmaLayout::Navigation).to receive(:user).and_return(OpenStruct.new(navigation: 'member'))
194
+ allow_any_instance_of(AmaLayout::AmaLayoutView).to receive(:render).and_return 'render'
195
+ expect(navigation_presenter.account_toggle).to eq('render')
142
196
  end
143
197
 
144
- it "in ama_layout it renders a blank partial" do
145
- allow_any_instance_of(AmaLayout::Navigation).to receive(:user).and_return(OpenStruct.new(navigation: "member"))
146
- allow_any_instance_of(AmaLayout::AmaLayoutView).to receive(:render).and_return "render"
147
- expect(navigation_presenter.account_toggle).to eq "render"
198
+ it 'in ama_layout it renders a blank partial' do
199
+ allow_any_instance_of(AmaLayout::Navigation).to receive(:user).and_return(OpenStruct.new(navigation: 'member'))
200
+ allow_any_instance_of(AmaLayout::AmaLayoutView).to receive(:render).and_return 'render'
201
+ expect(navigation_presenter.account_toggle).to eq('render')
148
202
  end
149
203
  end
150
204
 
151
- describe "ama layout view" do
152
- context "needed to allow rendering based on the view main app" do
153
- it "attaches additional methods to current decorator - draper is capable of the same thing" do
154
- expect(navigation_presenter.h(Helpers::AttachMethodsSample.new).additional_info).to eq "Bruce Wayne"
205
+ describe 'ama layout view' do
206
+ context 'needed to allow rendering based on the view main app' do
207
+ it 'attaches additional methods to current decorator - draper is capable of the same thing' do
208
+ expect(navigation_presenter.h(Helpers::AttachMethodsSample.new).additional_info).to eq('Bruce Wayne')
155
209
  end
156
210
  end
157
211
  end
@@ -217,7 +271,7 @@ describe AmaLayout::NavigationDecorator do
217
271
  end
218
272
 
219
273
  it 'does not return the badge markup' do
220
- expect(subject.notification_badge).to be nil
274
+ expect(subject.notification_badge).to eq('')
221
275
  end
222
276
  end
223
277
 
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :agent_navigation, class: AmaLayout::Agent::Navigation do
3
- current_url "http://waffleemporium.ca"
5
+ current_url { 'http://waffleemporium.ca' }
4
6
  end
5
7
  end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :navigation, class: AmaLayout::Navigation do
3
- current_url "http://waffleemporium.ca"
5
+ current_url { 'http://waffleemporium.ca' }
4
6
  end
5
7
  end
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :navigation_item, class: AmaLayout::NavigationItem do
3
- text "Gotham Overview"
4
- icon "fa-tachometer"
5
- link "http://waffleemporium.ca/gotica"
6
- alt "Back to my dashboard"
5
+ text { 'Gotham Overview' }
6
+ icon { 'fa-tachometer' }
7
+ link { 'http://waffleemporium.ca/gotica' }
8
+ alt { 'Back to my dashboard' }
7
9
  end
8
10
  end
@@ -1,35 +1,42 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.define do
2
4
  factory :user, class: Class.new(OpenStruct) do
3
- in_renewal false
4
- member_type 'P'
5
- renew_type 'R'
6
- status 'A'
7
- has_outstanding_balance false
8
- member? true
5
+ in_renewal { false }
6
+ member_type { 'P' }
7
+ renew_type { 'R' }
8
+ status { 'A' }
9
+ has_outstanding_balance { false }
10
+ member? { true }
11
+ menu_key { 'member' }
9
12
 
10
13
  trait :non_member do
11
- member? false
14
+ member? { false }
15
+ menu_key { 'non_member' }
12
16
  end
13
17
 
14
18
  trait :with_accr do
15
- renew_type 'A'
19
+ renew_type { 'A' }
16
20
  end
17
21
 
18
22
  trait :with_mpp do
19
- renew_type 'M'
23
+ renew_type { 'M' }
20
24
  end
21
25
 
22
26
  trait :in_renewal do
23
- in_renewal true
27
+ in_renewal { true }
28
+ menu_key { 'member_renewal' }
24
29
  end
25
30
 
26
31
  trait :in_renewal_late do
27
- in_renewal true
28
- status 'AL'
32
+ in_renewal { true }
33
+ status { 'AL' }
34
+ menu_key { 'member_renewal_late' }
29
35
  end
30
36
 
31
37
  trait :outstanding_balance do
32
- has_outstanding_balance true
38
+ has_outstanding_balance { true }
39
+ menu_key { 'member_outstanding_balance' }
33
40
  end
34
41
  end
35
42
  end
@@ -1,3 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  ActiveRecord::Schema.define do
2
- #
4
+ # Set up any tables you need to exist for your test suite that don't belong
5
+ # in migrations.
3
6
  end
metadata CHANGED
@@ -1,81 +1,76 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ama_layout
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.5.3
4
+ version: 10.0.1
5
5
  platform: ruby
6
6
  authors:
7
- - Michael van den Beuken
8
- - Ruben Estevez
9
- - Jordan Babe
10
- - Mathieu Gilbert
11
- - Ryan Jones
12
7
  - Darko Dosenovic
13
- - Jonathan Weyermann
14
- - Adam Melnyk
15
- - Kayt Campbell
16
- - Kathleen Robertson
17
8
  - Jesse Doyle
9
+ - Kayt Wilson
10
+ - Michael van den Beuken
11
+ - Sinead Errity
12
+ - Zoie Carnegie
18
13
  autorequire:
19
14
  bindir: bin
20
15
  cert_chain: []
21
- date: 2019-04-22 00:00:00.000000000 Z
16
+ date: 2020-01-23 00:00:00.000000000 Z
22
17
  dependencies:
23
18
  - !ruby/object:Gem::Dependency
24
- name: foundation-rails
19
+ name: breadcrumbs_on_rails
25
20
  requirement: !ruby/object:Gem::Requirement
26
21
  requirements:
27
- - - "<="
22
+ - - ">="
28
23
  - !ruby/object:Gem::Version
29
- version: 6.4.3.0
24
+ version: '3'
30
25
  type: :runtime
31
26
  prerelease: false
32
27
  version_requirements: !ruby/object:Gem::Requirement
33
28
  requirements:
34
- - - "<="
29
+ - - ">="
35
30
  - !ruby/object:Gem::Version
36
- version: 6.4.3.0
31
+ version: '3'
37
32
  - !ruby/object:Gem::Dependency
38
- name: rails
33
+ name: browser
39
34
  requirement: !ruby/object:Gem::Requirement
40
35
  requirements:
41
- - - ">="
36
+ - - "~>"
42
37
  - !ruby/object:Gem::Version
43
- version: '4.2'
38
+ version: '2.0'
44
39
  type: :runtime
45
40
  prerelease: false
46
41
  version_requirements: !ruby/object:Gem::Requirement
47
42
  requirements:
48
- - - ">="
43
+ - - "~>"
49
44
  - !ruby/object:Gem::Version
50
- version: '4.2'
45
+ version: '2.0'
51
46
  - !ruby/object:Gem::Dependency
52
- name: browser
47
+ name: foundation-rails
53
48
  requirement: !ruby/object:Gem::Requirement
54
49
  requirements:
55
- - - "~>"
50
+ - - "<="
56
51
  - !ruby/object:Gem::Version
57
- version: '2.0'
52
+ version: 6.4.3.0
58
53
  type: :runtime
59
54
  prerelease: false
60
55
  version_requirements: !ruby/object:Gem::Requirement
61
56
  requirements:
62
- - - "~>"
57
+ - - "<="
63
58
  - !ruby/object:Gem::Version
64
- version: '2.0'
59
+ version: 6.4.3.0
65
60
  - !ruby/object:Gem::Dependency
66
- name: breadcrumbs_on_rails
61
+ name: rails
67
62
  requirement: !ruby/object:Gem::Requirement
68
63
  requirements:
69
64
  - - ">="
70
65
  - !ruby/object:Gem::Version
71
- version: '3'
66
+ version: '4.2'
72
67
  type: :runtime
73
68
  prerelease: false
74
69
  version_requirements: !ruby/object:Gem::Requirement
75
70
  requirements:
76
71
  - - ">="
77
72
  - !ruby/object:Gem::Version
78
- version: '3'
73
+ version: '4.2'
79
74
  - !ruby/object:Gem::Dependency
80
75
  name: redis-rails
81
76
  requirement: !ruby/object:Gem::Requirement
@@ -96,30 +91,30 @@ dependencies:
96
91
  requirements:
97
92
  - - "~>"
98
93
  - !ruby/object:Gem::Version
99
- version: '1.11'
94
+ version: 1.17.3
100
95
  type: :development
101
96
  prerelease: false
102
97
  version_requirements: !ruby/object:Gem::Requirement
103
98
  requirements:
104
99
  - - "~>"
105
100
  - !ruby/object:Gem::Version
106
- version: '1.11'
101
+ version: 1.17.3
107
102
  - !ruby/object:Gem::Dependency
108
- name: rake
103
+ name: combustion
109
104
  requirement: !ruby/object:Gem::Requirement
110
105
  requirements:
111
106
  - - ">="
112
107
  - !ruby/object:Gem::Version
113
- version: '11.0'
108
+ version: '0'
114
109
  type: :development
115
110
  prerelease: false
116
111
  version_requirements: !ruby/object:Gem::Requirement
117
112
  requirements:
118
113
  - - ">="
119
114
  - !ruby/object:Gem::Version
120
- version: '11.0'
115
+ version: '0'
121
116
  - !ruby/object:Gem::Dependency
122
- name: rspec-rails
117
+ name: factory_bot
123
118
  requirement: !ruby/object:Gem::Requirement
124
119
  requirements:
125
120
  - - ">="
@@ -133,7 +128,7 @@ dependencies:
133
128
  - !ruby/object:Gem::Version
134
129
  version: '0'
135
130
  - !ruby/object:Gem::Dependency
136
- name: factory_bot
131
+ name: pry
137
132
  requirement: !ruby/object:Gem::Requirement
138
133
  requirements:
139
134
  - - ">="
@@ -147,21 +142,21 @@ dependencies:
147
142
  - !ruby/object:Gem::Version
148
143
  version: '0'
149
144
  - !ruby/object:Gem::Dependency
150
- name: simplecov
145
+ name: rake
151
146
  requirement: !ruby/object:Gem::Requirement
152
147
  requirements:
153
148
  - - ">="
154
149
  - !ruby/object:Gem::Version
155
- version: '0'
150
+ version: '11.0'
156
151
  type: :development
157
152
  prerelease: false
158
153
  version_requirements: !ruby/object:Gem::Requirement
159
154
  requirements:
160
155
  - - ">="
161
156
  - !ruby/object:Gem::Version
162
- version: '0'
157
+ version: '11.0'
163
158
  - !ruby/object:Gem::Dependency
164
- name: pry
159
+ name: rspec-rails
165
160
  requirement: !ruby/object:Gem::Requirement
166
161
  requirements:
167
162
  - - ">="
@@ -175,7 +170,7 @@ dependencies:
175
170
  - !ruby/object:Gem::Version
176
171
  version: '0'
177
172
  - !ruby/object:Gem::Dependency
178
- name: combustion
173
+ name: simplecov
179
174
  requirement: !ruby/object:Gem::Requirement
180
175
  requirements:
181
176
  - - ">="
@@ -218,23 +213,19 @@ dependencies:
218
213
  version: '0'
219
214
  description: ".ama.ab.ca site layouts"
220
215
  email:
221
- - michael.beuken@gmail.com
222
- - ruben.a.estevez@gmail.com
223
- - jorbabe@gmail.com
224
- - mathieu.gilbert@ama.ab.ca
225
- - ryan.michael.jones@gmail.com
226
216
  - darko.dosenovic@ama.ab.ca
227
- - jonathan.weyermann@ama.ab.ca
228
- - adam.melnyk@ama.ab.ca
229
- - kayt.campbell@ama.ab.ca
230
- - kathleen.robertson@ama.ab.ca
231
217
  - jesse.doyle@ama.ab.ca
218
+ - kayt.wilson@ama.ab.ca
219
+ - michael.beuken@gmail.com
220
+ - sinead.errity@ama.ab.ca
221
+ - zoie.carnegie@ama.ab.ca
232
222
  executables: []
233
223
  extensions: []
234
224
  extra_rdoc_files: []
235
225
  files:
236
226
  - ".gitignore"
237
227
  - ".rspec"
228
+ - ".ruby-version"
238
229
  - ".simplecov"
239
230
  - ".travis.yml"
240
231
  - Gemfile
@@ -274,6 +265,7 @@ files:
274
265
  - app/views/ama_layout/_footer.html.erb
275
266
  - app/views/ama_layout/_main_nav_item.html.erb
276
267
  - app/views/ama_layout/_main_top_nav_item.html.erb
268
+ - app/views/ama_layout/_manage_credit_card_link.html.erb
277
269
  - app/views/ama_layout/_mobile_links.html.erb
278
270
  - app/views/ama_layout/_mobile_notification_icon.html.erb
279
271
  - app/views/ama_layout/_notice.html.erb
@@ -294,6 +286,7 @@ files:
294
286
  - app/views/ama_layout/agent/_siteheader.html.erb
295
287
  - app/views/ama_layout/agent/_top_nav.html.erb
296
288
  - app/views/application/_account_toggle.html.erb
289
+ - config.ru
297
290
  - config/routes.rb
298
291
  - lib/ama_layout.rb
299
292
  - lib/ama_layout/agent/navigation.rb
@@ -350,6 +343,7 @@ files:
350
343
  - spec/helpers/ama_layout_breadcrumb_helper_spec.rb
351
344
  - spec/helpers/ama_layout_content_helper_spec.rb
352
345
  - spec/helpers/ama_layout_path_helper_spec.rb
346
+ - spec/internal/app/assets/config/manifest.js
353
347
  - spec/internal/app/controllers/application_controller.rb
354
348
  - spec/internal/app/controllers/pages_controller.rb
355
349
  - spec/internal/config/database.yml
@@ -380,7 +374,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
380
374
  version: '0'
381
375
  requirements: []
382
376
  rubyforge_project:
383
- rubygems_version: 2.5.2.3
377
+ rubygems_version: 2.7.6.2
384
378
  signing_key:
385
379
  specification_version: 4
386
380
  summary: ".ama.ab.ca site layouts"
@@ -415,6 +409,7 @@ test_files:
415
409
  - spec/helpers/ama_layout_breadcrumb_helper_spec.rb
416
410
  - spec/helpers/ama_layout_content_helper_spec.rb
417
411
  - spec/helpers/ama_layout_path_helper_spec.rb
412
+ - spec/internal/app/assets/config/manifest.js
418
413
  - spec/internal/app/controllers/application_controller.rb
419
414
  - spec/internal/app/controllers/pages_controller.rb
420
415
  - spec/internal/config/database.yml