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 +4 -4
- data/app/helpers/ama_layout_content_helper.rb +6 -2
- data/app/views/ama_layout/_alert.html.erb +1 -1
- data/app/views/ama_layout/_notice.html.erb +1 -1
- data/app/views/ama_layout/_notices.html.erb +1 -0
- data/app/views/ama_layout/_success.html.erb +5 -0
- data/lib/ama_layout/version.rb +1 -1
- data/spec/helpers/ama_layout_content_helper_spec.rb +21 -4
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa8f086b421e04a568cd142aa07ce8681bc3fa81
|
4
|
+
data.tar.gz: cf80b2122c15b33c52795ba01d234ec44d3b79bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/ama_layout/version.rb
CHANGED
@@ -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(
|
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(
|
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.
|
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-
|
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"
|