ama_layout 5.0.0 → 5.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
2
  SHA1:
3
- metadata.gz: 6c4c45872a4d9c7364830e2608e013fb967add8b
4
- data.tar.gz: 416226e109df2d68e0a32862041a698d6510018e
3
+ metadata.gz: fa8f086b421e04a568cd142aa07ce8681bc3fa81
4
+ data.tar.gz: cf80b2122c15b33c52795ba01d234ec44d3b79bb
5
5
  SHA512:
6
- metadata.gz: 6d52e119e36142afe61b1ef14d8a634771a361594d25af0fb713c9c93a1c393f72ca204accbea2c2a68b9b8a1e430eeab671064b88437791e39ffabf05e00b9e
7
- data.tar.gz: b07ba12a40395a966c8fb75de8bd9e703450e258178edc10878611816eb9eb31ec2100ea2a236c9a6ddac3c464dbdc661efcf96fc215b0c3cadb7b1f6fb62717
6
+ metadata.gz: 6b66da15b24bef593d076f5325186dc02a3a22f409146620234e5c51bc37b8e9640131e6a622e838be5821cf0fe188d2a490ffefd1b86b183ac88016b8a7a94e
7
+ data.tar.gz: f75b90e014e3280b16bb3f9b55dfce1f96b17d6c4406e8f40c7bb0cb5324ce96e4599800ecf84e0708beea2f4a5616e2e26775e127f997b62d03ceb552159104
@@ -47,10 +47,14 @@ module AmaLayoutContentHelper
47
47
  end
48
48
 
49
49
  def notice(notice)
50
- render "ama_layout/notice" if notice
50
+ render "ama_layout/notice", locals: { message: notice } if notice
51
51
  end
52
52
 
53
53
  def alert(alert)
54
- render "ama_layout/alert" if alert
54
+ render "ama_layout/alert", locals: { message: alert } if alert
55
+ end
56
+
57
+ def success_message(success)
58
+ render "ama_layout/success", locals: { message: success } if success
55
59
  end
56
60
  end
@@ -1,5 +1,5 @@
1
1
  <div class="row">
2
2
  <div class="large-12">
3
- <div class="error_notification"><span><%= flash[:alert].html_safe %></span></div>
3
+ <div class="error_notification"><span><%= message.html_safe %></span></div>
4
4
  </div>
5
5
  </div>
@@ -1,5 +1,5 @@
1
1
  <div class="row">
2
2
  <div class="large-12">
3
- <div class="notice_notification"><span><%= flash[:notice].html_safe %></span></div>
3
+ <div class="notice_notification"><span><%= message.html_safe %></span></div>
4
4
  </div>
5
5
  </div>
@@ -1,2 +1,3 @@
1
1
  <%= notice(flash[:notice]) %>
2
2
  <%= alert(flash[:alert]) %>
3
+ <%= success_message(flash[:success]) %>
@@ -0,0 +1,5 @@
1
+ <div class="row">
2
+ <div class="large-12">
3
+ <div class="success_notification"><span><%= message.html_safe %></span></div>
4
+ </div>
5
+ </div>
@@ -1,3 +1,3 @@
1
1
  module AmaLayout
2
- VERSION = '5.0.0'
2
+ VERSION = '5.0.1'
3
3
  end
@@ -120,9 +120,11 @@ describe AmaLayoutContentHelper do
120
120
  end
121
121
 
122
122
  describe "#notice" do
123
+ let(:message) { "This is a notice." }
124
+
123
125
  it "renders the notice partial if a notice is present" do
124
- expect(helper).to receive(:render).with "ama_layout/notice"
125
- helper.notice("This is a notice.")
126
+ expect(helper).to receive(:render).with "ama_layout/notice", locals: { message: message }
127
+ helper.notice(message)
126
128
  end
127
129
 
128
130
  it "does not render the notice partial if a notice is not present" do
@@ -131,13 +133,28 @@ describe AmaLayoutContentHelper do
131
133
  end
132
134
 
133
135
  describe "#alert" do
136
+ let(:message) { "This is an alert." }
137
+
134
138
  it "renders the alert partial if a alert is present" do
135
- expect(helper).to receive(:render).with "ama_layout/alert"
136
- helper.alert("This is an alert.")
139
+ expect(helper).to receive(:render).with "ama_layout/alert", locals: { message: message }
140
+ helper.alert(message)
137
141
  end
138
142
 
139
143
  it "does not render the alert partial if a alert is not present" do
140
144
  expect(helper.notice(nil)).to be_nil
141
145
  end
142
146
  end
147
+
148
+ describe "#success_message" do
149
+ let(:message) { "This is a success message" }
150
+
151
+ it "renders the success partial if a success message is present" do
152
+ expect(helper).to receive(:render).with "ama_layout/success", locals: { message: message }
153
+ helper.success_message(message)
154
+ end
155
+
156
+ it "does not render the success partial if the success message is not present" do
157
+ expect(helper.success_message(nil)).to be_nil
158
+ end
159
+ end
143
160
  end
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: 5.0.0
4
+ version: 5.0.1
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-02-28 00:00:00.000000000 Z
21
+ date: 2017-03-13 00:00:00.000000000 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
24
  name: foundation-rails
@@ -262,6 +262,7 @@ files:
262
262
  - app/views/ama_layout/_siteheader.html.erb
263
263
  - app/views/ama_layout/_sub_nav.html.erb
264
264
  - app/views/ama_layout/_sub_nav_item.html.erb
265
+ - app/views/ama_layout/_success.html.erb
265
266
  - app/views/ama_layout/_top_nav.html.erb
266
267
  - app/views/ama_layout/_top_sub_nav.html.erb
267
268
  - app/views/ama_layout/_top_sub_nav_item.html.erb
@@ -323,7 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
323
324
  version: '0'
324
325
  requirements: []
325
326
  rubyforge_project:
326
- rubygems_version: 2.5.1
327
+ rubygems_version: 2.4.5.1
327
328
  signing_key:
328
329
  specification_version: 4
329
330
  summary: ".ama.ab.ca site layouts"