ama_layout 8.0.2 → 9.0.0

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: ba422e9a28b42d0d5b030db721a5f73bc55733ef
4
- data.tar.gz: 354156b125b79739e813462d65b4fea6b435191d
3
+ metadata.gz: '05548c0c4d9d43880761679cbfd8f8f1ce52ef1f'
4
+ data.tar.gz: a1eec1a2d699f9f3ae9d0d972b332ed88daece13
5
5
  SHA512:
6
- metadata.gz: 30bd40fa39479ff6a31c1c628720701e65fe7955f6afc1bfff473059e49b86858af2c19cd5d41022be4e6a8be95f3322afe2e9833280272c6b15906a8b8d97ad
7
- data.tar.gz: 880d1ae33fc28d6ae6158a18570d4301529b41ede09eefa64b02935d620039029218df8c4a6cfcd468fbb736624e85c9ef9dc5ee449c7917876810d9054c4ea7
6
+ metadata.gz: de302c59d56d01e9456ea3e566df7dfca6ab9cf4b74d832cf0f48d5cb71ebdebf4c1defc5511a1027e03275281d5431ee272d9cc79a1d67c1ecc9b392a1f6c35
7
+ data.tar.gz: 4c2b91ea3e0aa168a30043cd2799632e0726f947d22da484ae3b0ec8cf595159b255c8d15a4c6e7b0949bc7178551b3b5fe087bbdd4f72d56b33f85dae0b59e5
@@ -0,0 +1,22 @@
1
+ <div class="off-canvas position-left" id="offCanvasLeft" data-off-canvas>
2
+ <h2 class="side-nav__header">Online Account</h2>
3
+ <div class="side-nav__content">
4
+ <ul class="side-nav__list">
5
+ <li class="side-nav__item">
6
+ <%= link_to 'Sign In', "#{Rails.configuration.gatekeeper_site}/login", class: 'side-nav__link' %>
7
+ </li>
8
+ <li class="side-nav__item">
9
+ <a class="side-nav__link" href="<%= Rails.configuration.amaabca_site %>">AMA Website</a>
10
+ </li>
11
+ <li class="side-nav__item">
12
+ <a class="side-nav__link" href="http://amaroadreports.ca/">AMA Road Reports</a>
13
+ </li>
14
+ <li class="side-nav__item">
15
+ <a class="side-nav__link" href="https://albertamotorassociation.zendesk.com/hc/en-us" target="_blank">Help</a>
16
+ </li>
17
+ <li class="side-nav__item">
18
+ <a class="side-nav__link" href="<%= Rails.configuration.amaabca_site %>/membership/contact-us--centre-locations-hours-and-contact-information">Contact Us</a>
19
+ </li>
20
+ </ul>
21
+ </div>
22
+ </div>
@@ -23,28 +23,7 @@
23
23
  </div>
24
24
  </div>
25
25
  </div>
26
- <div class="off-canvas position-left" id="offCanvasLeft" data-off-canvas>
27
- <h2 class="side-nav__header">Online Account</h2>
28
- <div class="side-nav__content">
29
- <ul class="side-nav__list">
30
- <%= navigation.account_toggle(self) %>
31
- <%= render partial: "ama_layout/main_nav_item", collection: navigation.items, as: :nav_item %>
32
- <li class="side-nav__item">
33
- <a class="side-nav__link" href="<%= Rails.configuration.amaabca_site %>">AMA Website</a>
34
- </li>
35
- <li class="side-nav__item">
36
- <a class="side-nav__link" href="http://amaroadreports.ca/">AMA Road Reports</a>
37
- </li>
38
- <li class="side-nav__item">
39
- <a class="side-nav__link" href="https://albertamotorassociation.zendesk.com/hc/en-us" target="_blank">Help</a>
40
- </li>
41
- <li class="side-nav__item">
42
- <a class="side-nav__link" href="<%= Rails.configuration.amaabca_site %>/membership/contact-us--centre-locations-hours-and-contact-information">Contact Us</a>
43
- </li>
44
- <%= navigation.sign_out_link %>
45
- </ul>
46
- </div>
47
- </div>
26
+ <%= navigation.mobile_links %>
48
27
  <%= navigation.notification_sidebar %>
49
28
  <div class="javascript_errors error_notification" hidden></div>
50
29
  <noscript>
@@ -43,6 +43,10 @@ module AmaLayout
43
43
  end
44
44
  end
45
45
 
46
+ def mobile_links
47
+ h.render 'ama_layout/mobile_links' unless user
48
+ end
49
+
46
50
  def notification_badge
47
51
  if new_notifications?
48
52
  h.content_tag(
@@ -1,3 +1,3 @@
1
1
  module AmaLayout
2
- VERSION = '8.0.2'
2
+ VERSION = '9.0.0'
3
3
  end
@@ -1,26 +1,18 @@
1
1
  describe AmaLayout::NavigationDecorator do
2
2
  let(:navigation) { FactoryGirl.build(:navigation) }
3
3
  let(:navigation_presenter) { navigation.decorate }
4
- let(:gatekeeper_site) { "http://auth.waffles.ca" }
5
- let(:youraccount_site) { "http://youraccount.waffles.ca" }
6
- let(:insurance_site) { "http://insurance.waffles.ca" }
7
- let(:membership_site) { "http://membership.waffles.ca" }
8
- let(:driveredonline_site) { "http://driveredonline.waffles.ca" }
9
- let(:registries_site) { "http://registries.waffles.ca" }
10
- let(:automotive_site) { "http://automotive.waffles.ca" }
11
- let(:travel_site) { "http://travel.waffles.ca" }
12
- let(:travel_login_url) { "http://travel.waffles.ca/MyAccount" }
13
4
 
14
5
  before(:each) do
15
- allow(Rails.configuration).to receive(:gatekeeper_site).and_return(gatekeeper_site)
16
- allow(Rails.configuration).to receive(:youraccount_site).and_return(youraccount_site)
17
- allow(Rails.configuration).to receive(:insurance_site).and_return(insurance_site)
18
- allow(Rails.configuration).to receive(:membership_site).and_return(membership_site)
19
- allow(Rails.configuration).to receive(:driveredonline_site).and_return(driveredonline_site)
20
- allow(Rails.configuration).to receive(:registries_site).and_return(registries_site)
21
- allow(Rails.configuration).to receive(:automotive_site).and_return(automotive_site)
22
- allow(Rails.configuration).to receive(:travel_site).and_return(travel_site)
23
- allow(Rails.configuration).to receive(:travel_login_url).and_return(travel_login_url)
6
+ Rails.configuration.gatekeeper_site = 'http://auth.waffles.ca'
7
+ Rails.configuration.youraccount_site = 'http://youraccount.waffles.ca'
8
+ Rails.configuration.insurance_site = 'http://insurance.waffles.ca'
9
+ Rails.configuration.membership_site = 'http://membership.waffles.ca'
10
+ Rails.configuration.driveredonline_site = 'http://driveredonline.waffles.ca'
11
+ Rails.configuration.registries_site = 'http://registries.waffles.ca'
12
+ Rails.configuration.automotive_site = 'http://automotive.waffles.ca'
13
+ Rails.configuration.travel_site = 'http://travel.waffles.ca'
14
+ Rails.configuration.travel_login_url = 'http://travel.waffles.ca/MyAccount'
15
+ Rails.configuration.amaabca_site = 'http://test.ama.ab.ca/'
24
16
  end
25
17
 
26
18
  describe "#display_name_text" do
@@ -77,6 +69,24 @@ describe AmaLayout::NavigationDecorator do
77
69
  end
78
70
  end
79
71
 
72
+ describe '#mobile_links' do
73
+ context 'with user' do
74
+ before(:each) do
75
+ navigation_presenter.object = OpenStruct.new(user: true)
76
+ end
77
+
78
+ it 'returns nil' do
79
+ expect(navigation_presenter.mobile_links).to be_nil
80
+ end
81
+ end
82
+
83
+ context 'without user' do
84
+ it 'renders an offcanvas menu' do
85
+ expect(navigation_presenter.mobile_links).to include('off-canvas')
86
+ end
87
+ end
88
+ end
89
+
80
90
  describe "#sign_out_link" do
81
91
  context "with user" do
82
92
  it "returns link" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ama_layout
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.2
4
+ version: 9.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael van den Beuken
@@ -18,7 +18,7 @@ authors:
18
18
  autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
- date: 2017-10-06 00:00:00.000000000 Z
21
+ date: 2017-10-10 00:00:00.000000000 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
24
  name: foundation-rails
@@ -273,6 +273,7 @@ files:
273
273
  - app/views/ama_layout/_footer.html.erb
274
274
  - app/views/ama_layout/_main_nav_item.html.erb
275
275
  - app/views/ama_layout/_main_top_nav_item.html.erb
276
+ - app/views/ama_layout/_mobile_links.html.erb
276
277
  - app/views/ama_layout/_mobile_notification_icon.html.erb
277
278
  - app/views/ama_layout/_notice.html.erb
278
279
  - app/views/ama_layout/_notices.html.erb