bootstrap-navbar 1.0.0.pre1 → 1.0.0.pre2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e6cb5d7ab4f17cc09849836050063a1759811c1
|
4
|
+
data.tar.gz: 4f4ed9a21184025348dc77eb803b93a3a18fa1b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 589e6877047fdc0dcf224219d9a89ecca22ef1e1b8efdffadedabf918f0e02a4e57778f35bfc9d62b72fb3df35f6e6d5f31085d36011d4189f707348c70cce3a
|
7
|
+
data.tar.gz: 8def888b261d8445b59bcc2ee7010fd44b9aec41fdc48f6ec1144f75e3c189692cd08f89f474b891b45de7c2795a6da0bff43067a0a263ea9d2a6b3e4ae8a6ac
|
@@ -1,7 +1,15 @@
|
|
1
1
|
module BootstrapNavbar::Helpers::Bootstrap3
|
2
2
|
def navbar(options = {}, &block)
|
3
|
+
container = options.has_key?(:container) ? options[:container] : true
|
4
|
+
navbar_content =
|
5
|
+
navbar_header(options[:brand], options[:brand_link]) <<
|
6
|
+
navbar_collapsable(&block)
|
3
7
|
navbar_wrapper options do
|
4
|
-
|
8
|
+
if container
|
9
|
+
navbar_container(navbar_content)
|
10
|
+
else
|
11
|
+
navbar_content
|
12
|
+
end
|
5
13
|
end
|
6
14
|
end
|
7
15
|
|
@@ -79,6 +87,14 @@ HTML
|
|
79
87
|
|
80
88
|
private
|
81
89
|
|
90
|
+
def navbar_container(content)
|
91
|
+
prepare_html <<-HTML.chomp!
|
92
|
+
<div class="container">
|
93
|
+
#{content}
|
94
|
+
</div>
|
95
|
+
HTML
|
96
|
+
end
|
97
|
+
|
82
98
|
def navbar_header(brand, brand_link)
|
83
99
|
prepare_html <<-HTML.chomp!
|
84
100
|
<div class="navbar-header">
|
@@ -93,6 +109,14 @@ HTML
|
|
93
109
|
HTML
|
94
110
|
end
|
95
111
|
|
112
|
+
def navbar_collapsable(&block)
|
113
|
+
prepare_html <<-HTML.chomp!
|
114
|
+
<div class="collapse navbar-collapse" id="navbar-collapsable">
|
115
|
+
#{capture(&block) if block_given?}
|
116
|
+
</div>
|
117
|
+
HTML
|
118
|
+
end
|
119
|
+
|
96
120
|
def brand_link(name, url = nil)
|
97
121
|
prepare_html %(<a href="#{url || '/'}" class="navbar-brand">#{name}</a>)
|
98
122
|
end
|
@@ -41,7 +41,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
41
41
|
context 'with a block' do
|
42
42
|
it 'generates the correct HTML' do
|
43
43
|
with_all_2_dot_x_versions do
|
44
|
-
expect(renderer.navbar { 'foo' }).to have_tag(:div, with: { class: 'navbar' },
|
44
|
+
expect(renderer.navbar { 'foo' }).to have_tag(:div, with: { class: 'navbar' }, text: /foo/)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -75,8 +75,8 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
75
75
|
context 'with "brand" and "brank_link" parameters' do
|
76
76
|
it 'generates the correct HTML' do
|
77
77
|
with_all_2_dot_x_versions do
|
78
|
-
expect(renderer.navbar(brand: 'foo')).to have_tag(:a, with: { href: '/', class: 'brand' },
|
79
|
-
expect(renderer.navbar(brand: 'foo', brand_link: 'http://google.com')).to have_tag(:a, with: { href: 'http://google.com', class: 'brand' },
|
78
|
+
expect(renderer.navbar(brand: 'foo')).to have_tag(:a, with: { href: '/', class: 'brand' }, text: /foo/)
|
79
|
+
expect(renderer.navbar(brand: 'foo', brand_link: 'http://google.com')).to have_tag(:a, with: { href: 'http://google.com', class: 'brand' }, text: /foo/)
|
80
80
|
expect(renderer.navbar(brand_link: 'http://google.com')).to have_tag(:a, with: { href: 'http://google.com', class: 'brand' })
|
81
81
|
end
|
82
82
|
end
|
@@ -114,7 +114,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
114
114
|
it 'generates the correct HTML' do
|
115
115
|
with_all_2_dot_x_versions do
|
116
116
|
expect(renderer.menu_group).to have_tag(:ul, with: { class: 'nav' })
|
117
|
-
expect(renderer.menu_group { 'foo' }).to have_tag(:ul, with: { class: 'nav' },
|
117
|
+
expect(renderer.menu_group { 'foo' }).to have_tag(:ul, with: { class: 'nav' }, text: /foo/)
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
@@ -212,7 +212,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
212
212
|
with_all_2_dot_x_versions do
|
213
213
|
BootstrapNavbar.configuration.current_url_method = '"/"'
|
214
214
|
expect(renderer.menu_item('foo', '/', {}, class: 'pelle', id: 'fant')).to have_tag(:li, with: { class: 'active' }) do
|
215
|
-
with_tag :a, with: { href: '/', class: 'pelle', id: 'fant' },
|
215
|
+
with_tag :a, with: { href: '/', class: 'pelle', id: 'fant' }, text: /foo/
|
216
216
|
end
|
217
217
|
end
|
218
218
|
end
|
@@ -223,7 +223,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
223
223
|
with_all_2_dot_x_versions do
|
224
224
|
BootstrapNavbar.configuration.current_url_method = '"/"'
|
225
225
|
expect(renderer.menu_item('foo', '/', { class: 'bar', id: 'baz' }, class: 'pelle', id: 'fant')).to have_tag(:li, with: { class: 'active bar', id: 'baz' }) do
|
226
|
-
with_tag :a, with: { href: '/', class: 'pelle', id: 'fant' },
|
226
|
+
with_tag :a, with: { href: '/', class: 'pelle', id: 'fant' }, text: /foo/
|
227
227
|
end
|
228
228
|
end
|
229
229
|
end
|
@@ -235,18 +235,17 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
235
235
|
with_all_2_dot_x_versions do
|
236
236
|
BootstrapNavbar.configuration.current_url_method = '"/foo"'
|
237
237
|
expect(renderer.menu_item('foo')).to have_tag(:li, without: { class: 'active' }) do
|
238
|
-
with_tag :a, with: { href: '#' },
|
238
|
+
with_tag :a, with: { href: '#' }, text: /foo/
|
239
239
|
end
|
240
240
|
expect(renderer.menu_item('foo', '/')).to have_tag(:li, without: { class: 'active' }) do
|
241
|
-
with_tag :a, with: { href: '/' },
|
241
|
+
with_tag :a, with: { href: '/' }, text: /foo/
|
242
242
|
end
|
243
243
|
expect(renderer.menu_item('foo', '/bar')).to have_tag(:li, without: { class: 'active' }) do
|
244
|
-
with_tag :a, with: { href: '/bar' },
|
244
|
+
with_tag :a, with: { href: '/bar' }, text: /foo/
|
245
245
|
end
|
246
|
-
|
247
246
|
BootstrapNavbar.configuration.current_url_method = '"/"'
|
248
247
|
expect(renderer.menu_item('foo', '/foo')).to have_tag(:li, without: { class: 'active' }) do
|
249
|
-
with_tag :a, with: { href: '/foo' },
|
248
|
+
with_tag :a, with: { href: '/foo' }, text: /foo/
|
250
249
|
end
|
251
250
|
end
|
252
251
|
end
|
@@ -265,7 +264,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
265
264
|
it 'generates the correct HTML' do
|
266
265
|
with_all_2_dot_x_versions do
|
267
266
|
expect(renderer.menu_item { 'bar' }).to have_tag(:li) do
|
268
|
-
with_tag :a, with: { href: '#' },
|
267
|
+
with_tag :a, with: { href: '#' }, text: /bar/
|
269
268
|
end
|
270
269
|
end
|
271
270
|
end
|
@@ -274,7 +273,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
274
273
|
it 'generates the correct HTML' do
|
275
274
|
with_all_2_dot_x_versions do
|
276
275
|
expect(renderer.menu_item('/foo', class: 'pelle', id: 'fant') { 'bar' }).to have_tag(:li, with: { class: 'pelle', id: 'fant' }) do
|
277
|
-
with_tag :a, with: { href: '/foo' },
|
276
|
+
with_tag :a, with: { href: '/foo' }, text: /bar/
|
278
277
|
end
|
279
278
|
end
|
280
279
|
end
|
@@ -284,7 +283,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
284
283
|
it 'generates the correct HTML' do
|
285
284
|
with_all_2_dot_x_versions do
|
286
285
|
expect(renderer.menu_item('/foo', {}, class: 'pelle', id: 'fant') { 'bar' }).to have_tag(:li) do
|
287
|
-
with_tag :a, with: { href: '/foo', class: 'pelle', id: 'fant' },
|
286
|
+
with_tag :a, with: { href: '/foo', class: 'pelle', id: 'fant' }, text: /bar/
|
288
287
|
end
|
289
288
|
end
|
290
289
|
end
|
@@ -294,7 +293,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
294
293
|
it 'generates the correct HTML' do
|
295
294
|
with_all_2_dot_x_versions do
|
296
295
|
expect(renderer.menu_item('/foo', { class: 'bar', id: 'baz' }, class: 'pelle', id: 'fant') { 'shnoo' }).to have_tag(:li, with: { class: 'bar', id: 'baz' }) do
|
297
|
-
with_tag :a, with: { href: '/foo', class: 'pelle', id: 'fant' },
|
296
|
+
with_tag :a, with: { href: '/foo', class: 'pelle', id: 'fant' }, text: /shnoo/
|
298
297
|
end
|
299
298
|
end
|
300
299
|
end
|
@@ -335,12 +334,12 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
335
334
|
it 'generates the correct HTML' do
|
336
335
|
with_all_2_dot_x_versions do
|
337
336
|
expect(renderer.sub_drop_down('foo')).to have_tag(:li, with: { class: 'dropdown-submenu' }) do
|
338
|
-
with_tag :a, with: { href: '#' },
|
337
|
+
with_tag :a, with: { href: '#' }, text: /foo/
|
339
338
|
with_drop_down_menu
|
340
339
|
end
|
341
340
|
|
342
341
|
expect(renderer.sub_drop_down('foo') { 'bar' }).to have_tag(:li, with: { class: 'dropdown-submenu' }) do
|
343
|
-
with_tag :a, with: { href: '#' },
|
342
|
+
with_tag :a, with: { href: '#' }, text: /foo/
|
344
343
|
with_drop_down_menu('bar')
|
345
344
|
end
|
346
345
|
end
|
@@ -350,7 +349,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
350
349
|
it 'generates the correct HTML' do
|
351
350
|
with_all_2_dot_x_versions do
|
352
351
|
expect(renderer.sub_drop_down('foo', class: 'bar', id: 'baz')).to have_tag(:li, with: { class: 'dropdown-submenu bar', id: 'baz' }) do
|
353
|
-
with_tag :a, with: { href: '#' },
|
352
|
+
with_tag :a, with: { href: '#' }, text: /foo/
|
354
353
|
end
|
355
354
|
end
|
356
355
|
end
|
@@ -360,7 +359,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
360
359
|
it 'generates the correct HTML' do
|
361
360
|
with_all_2_dot_x_versions do
|
362
361
|
expect(renderer.sub_drop_down('foo', {}, class: 'pelle', id: 'fant')).to have_tag(:li, with: { class: 'dropdown-submenu' }) do
|
363
|
-
with_tag :a, with: { href: '#', class: 'pelle', id: 'fant' },
|
362
|
+
with_tag :a, with: { href: '#', class: 'pelle', id: 'fant' }, text: /foo/
|
364
363
|
end
|
365
364
|
end
|
366
365
|
end
|
@@ -370,7 +369,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
370
369
|
it 'generates the correct HTML' do
|
371
370
|
with_all_2_dot_x_versions do
|
372
371
|
expect(renderer.sub_drop_down('foo', { class: 'bar', id: 'baz' }, class: 'pelle', id: 'fant')).to have_tag(:li, with: { class: 'dropdown-submenu bar', id: 'baz' }) do
|
373
|
-
with_tag :a, with: { href: '#', class: 'pelle', id: 'fant' },
|
372
|
+
with_tag :a, with: { href: '#', class: 'pelle', id: 'fant' }, text: /foo/
|
374
373
|
end
|
375
374
|
end
|
376
375
|
end
|
@@ -381,7 +380,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
381
380
|
describe '#drop_down_divider' do
|
382
381
|
it 'generates the correct HTML' do
|
383
382
|
with_all_2_dot_x_versions do
|
384
|
-
expect(renderer.drop_down_divider).to have_tag(:li, with: { class: 'divider' },
|
383
|
+
expect(renderer.drop_down_divider).to have_tag(:li, with: { class: 'divider' }, text: '')
|
385
384
|
end
|
386
385
|
end
|
387
386
|
end
|
@@ -389,7 +388,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
389
388
|
describe '#drop_down_header' do
|
390
389
|
it 'generates the correct HTML' do
|
391
390
|
with_all_2_dot_x_versions do
|
392
|
-
expect(renderer.drop_down_header('foo')).to have_tag(:li, with: { class: 'nav-header' },
|
391
|
+
expect(renderer.drop_down_header('foo')).to have_tag(:li, with: { class: 'nav-header' }, text: /foo/)
|
393
392
|
end
|
394
393
|
end
|
395
394
|
end
|
@@ -397,7 +396,7 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
397
396
|
describe '#menu_divider' do
|
398
397
|
it 'generates the correct HTML' do
|
399
398
|
with_all_2_dot_x_versions do
|
400
|
-
expect(renderer.menu_divider).to have_tag(:li, with: { class: 'divider-vertical' },
|
399
|
+
expect(renderer.menu_divider).to have_tag(:li, with: { class: 'divider-vertical' }, text: '')
|
401
400
|
end
|
402
401
|
end
|
403
402
|
end
|
@@ -405,10 +404,10 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
405
404
|
describe '#menu_text' do
|
406
405
|
it 'generates the correct HTML' do
|
407
406
|
with_all_2_dot_x_versions do
|
408
|
-
expect(renderer.menu_text('foo')).to have_tag(:p, with: { class: 'navbar-text' },
|
409
|
-
expect(renderer.menu_text { 'foo' }).to have_tag(:p, with: { class: 'navbar-text' },
|
410
|
-
expect(renderer.menu_text('foo', 'right')).to have_tag(:p, with: { class: 'navbar-text pull-right' },
|
411
|
-
expect(renderer.menu_text(nil, 'left') { 'foo' }).to have_tag(:p, with: { class: 'navbar-text pull-left' },
|
407
|
+
expect(renderer.menu_text('foo')).to have_tag(:p, with: { class: 'navbar-text' }, text: /foo/)
|
408
|
+
expect(renderer.menu_text { 'foo' }).to have_tag(:p, with: { class: 'navbar-text' }, text: /foo/)
|
409
|
+
expect(renderer.menu_text('foo', 'right')).to have_tag(:p, with: { class: 'navbar-text pull-right' }, text: /foo/)
|
410
|
+
expect(renderer.menu_text(nil, 'left') { 'foo' }).to have_tag(:p, with: { class: 'navbar-text pull-left' }, text: /foo/)
|
412
411
|
end
|
413
412
|
end
|
414
413
|
end
|
@@ -416,8 +415,8 @@ describe BootstrapNavbar::Helpers::Bootstrap2 do
|
|
416
415
|
describe '#brand_link' do
|
417
416
|
it 'generates the correct HTML' do
|
418
417
|
with_all_2_dot_x_versions do
|
419
|
-
expect(renderer.brand_link('foo')).to have_tag(:a, with: { class: 'brand', href: '/' },
|
420
|
-
expect(renderer.brand_link('foo', '/foo')).to have_tag(:a, with: { class: 'brand', href: '/foo' },
|
418
|
+
expect(renderer.brand_link('foo')).to have_tag(:a, with: { class: 'brand', href: '/' }, text: /foo/)
|
419
|
+
expect(renderer.brand_link('foo', '/foo')).to have_tag(:a, with: { class: 'brand', href: '/foo' }, text: /foo/)
|
421
420
|
end
|
422
421
|
end
|
423
422
|
end
|
@@ -7,7 +7,7 @@ shared_examples 'active navbar link' do
|
|
7
7
|
paths_and_urls.each do |menu_path_or_url|
|
8
8
|
BootstrapNavbar.configuration.current_url_method = "'#{current_path_or_url}'"
|
9
9
|
expect(renderer.navbar_group_item('foo', menu_path_or_url)).to have_tag(:li, with: { class: 'active' }) do
|
10
|
-
with_tag :a, with: { href: menu_path_or_url },
|
10
|
+
with_tag :a, with: { href: menu_path_or_url }, text: /foo/
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -32,16 +32,18 @@ describe BootstrapNavbar::Helpers::Bootstrap3 do
|
|
32
32
|
it 'generates the correct HTML' do
|
33
33
|
with_all_3_dot_x_versions do
|
34
34
|
expect(renderer.navbar { 'foo' }).to have_tag(:nav, with: { class: 'navbar navbar-default', role: 'navigation' }) do
|
35
|
-
with_tag :div, with: { class: '
|
36
|
-
with_tag :
|
37
|
-
with_tag :
|
38
|
-
|
39
|
-
|
35
|
+
with_tag :div, with: { class: 'container' } do
|
36
|
+
with_tag :div, with: { class: 'navbar-header' } do
|
37
|
+
with_tag :button, with: { type: 'button', class: 'navbar-toggle', :'data-toggle' => 'collapse', :'data-target' => '#navbar-collapsable' } do
|
38
|
+
with_tag :span, with: { class: 'sr-only' }, text: /Toggle navigation/
|
39
|
+
3.times do
|
40
|
+
with_tag :span, with: { class: 'icon-bar' }
|
41
|
+
end
|
40
42
|
end
|
43
|
+
with_tag :a, with: { class: 'navbar-brand', href: '/' }
|
41
44
|
end
|
42
|
-
with_tag :
|
45
|
+
with_tag :div, with: { class: 'collapse navbar-collapse', id: 'navbar-collapsable' }, text: /foo/
|
43
46
|
end
|
44
|
-
with_tag :div, class: 'collapse navbar-collapse', id: 'navbar-collapsable', content: 'foo'
|
45
47
|
end
|
46
48
|
end
|
47
49
|
end
|
@@ -55,6 +57,19 @@ describe BootstrapNavbar::Helpers::Bootstrap3 do
|
|
55
57
|
end
|
56
58
|
end
|
57
59
|
|
60
|
+
context 'with "container" parameter' do
|
61
|
+
it 'generates the correct HTML' do
|
62
|
+
with_all_3_dot_x_versions do
|
63
|
+
expect(renderer.navbar(container: true)).to have_tag(:nav, with: { class: 'navbar navbar-default' }) do
|
64
|
+
with_tag :div, with: { class: 'container' }
|
65
|
+
end
|
66
|
+
expect(renderer.navbar(container: false)).to have_tag(:nav, with: { class: 'navbar navbar-default' }) do
|
67
|
+
without_tag :div, with: { class: 'container' }
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
58
73
|
context 'with "fixed" parameter' do
|
59
74
|
it 'generates the correct HTML' do
|
60
75
|
with_all_3_dot_x_versions do
|
@@ -75,8 +90,8 @@ describe BootstrapNavbar::Helpers::Bootstrap3 do
|
|
75
90
|
context 'with "brand" and "brank_link" parameters' do
|
76
91
|
it 'generates the correct HTML' do
|
77
92
|
with_all_3_dot_x_versions do
|
78
|
-
expect(renderer.navbar(brand: 'foo')).to have_tag(:a, with: { href: '/', class: 'navbar-brand' },
|
79
|
-
expect(renderer.navbar(brand: 'foo', brand_link: 'http://google.com')).to have_tag(:a, with: { href: 'http://google.com', class: 'navbar-brand' },
|
93
|
+
expect(renderer.navbar(brand: 'foo')).to have_tag(:a, with: { href: '/', class: 'navbar-brand' }, text: /foo/)
|
94
|
+
expect(renderer.navbar(brand: 'foo', brand_link: 'http://google.com')).to have_tag(:a, with: { href: 'http://google.com', class: 'navbar-brand' }, text: /foo/)
|
80
95
|
expect(renderer.navbar(brand_link: 'http://google.com')).to have_tag(:a, with: { href: 'http://google.com', class: 'navbar-brand' })
|
81
96
|
end
|
82
97
|
end
|
@@ -110,7 +125,7 @@ describe BootstrapNavbar::Helpers::Bootstrap3 do
|
|
110
125
|
with_text 'foo '
|
111
126
|
with_tag :b, with: { class: 'caret' }
|
112
127
|
end
|
113
|
-
with_tag :ul, with: { class: 'dropdown-menu' },
|
128
|
+
with_tag :ul, with: { class: 'dropdown-menu' }, text: /bar/
|
114
129
|
end
|
115
130
|
end
|
116
131
|
end
|
@@ -168,15 +183,14 @@ describe BootstrapNavbar::Helpers::Bootstrap3 do
|
|
168
183
|
with_all_3_dot_x_versions do
|
169
184
|
BootstrapNavbar.configuration.current_url_method = '"/foo"'
|
170
185
|
expect(renderer.navbar_group_item('foo', '/')).to have_tag(:li, without: { class: 'active' }) do
|
171
|
-
with_tag :a, with: { href: '/' },
|
186
|
+
with_tag :a, with: { href: '/' }, text: /foo/
|
172
187
|
end
|
173
188
|
expect(renderer.navbar_group_item('foo', '/bar')).to have_tag(:li, without: { class: 'active' }) do
|
174
|
-
with_tag :a, with: { href: '/bar' },
|
189
|
+
with_tag :a, with: { href: '/bar' }, text: /foo/
|
175
190
|
end
|
176
|
-
|
177
191
|
BootstrapNavbar.configuration.current_url_method = '"/"'
|
178
192
|
expect(renderer.navbar_group_item('foo', '/foo')).to have_tag(:li, without: { class: 'active' }) do
|
179
|
-
with_tag :a, with: { href: '/foo' },
|
193
|
+
with_tag :a, with: { href: '/foo' }, text: /foo/
|
180
194
|
end
|
181
195
|
end
|
182
196
|
end
|
@@ -187,7 +201,7 @@ describe BootstrapNavbar::Helpers::Bootstrap3 do
|
|
187
201
|
context 'without parameters' do
|
188
202
|
it 'generates the correct HTML' do
|
189
203
|
with_all_3_dot_x_versions do
|
190
|
-
expect(renderer.navbar_form { 'foo' }).to have_tag(:form, with: { class: 'navbar-form', role: 'form' },
|
204
|
+
expect(renderer.navbar_form { 'foo' }).to have_tag(:form, with: { class: 'navbar-form', role: 'form' }, text: /foo/)
|
191
205
|
end
|
192
206
|
end
|
193
207
|
end
|
@@ -195,7 +209,7 @@ describe BootstrapNavbar::Helpers::Bootstrap3 do
|
|
195
209
|
context 'with "align" parameter' do
|
196
210
|
it 'generates the correct HTML' do
|
197
211
|
with_all_3_dot_x_versions do
|
198
|
-
expect(renderer.navbar_form(align: 'left') { 'foo' }).to have_tag(:form, with: { class: 'navbar-form navbar-left', role: 'form' },
|
212
|
+
expect(renderer.navbar_form(align: 'left') { 'foo' }).to have_tag(:form, with: { class: 'navbar-form navbar-left', role: 'form' }, text: /foo/)
|
199
213
|
end
|
200
214
|
end
|
201
215
|
end
|
@@ -229,7 +243,7 @@ describe BootstrapNavbar::Helpers::Bootstrap3 do
|
|
229
243
|
context 'with "text" parameter' do
|
230
244
|
it 'generates the correct HTML' do
|
231
245
|
with_all_3_dot_x_versions do
|
232
|
-
expect(renderer.navbar_text('foo')).to have_tag(:p, with: { class: 'navbar-text' },
|
246
|
+
expect(renderer.navbar_text('foo')).to have_tag(:p, with: { class: 'navbar-text' }, text: /foo/)
|
233
247
|
end
|
234
248
|
end
|
235
249
|
end
|
@@ -237,7 +251,7 @@ describe BootstrapNavbar::Helpers::Bootstrap3 do
|
|
237
251
|
context 'with block' do
|
238
252
|
it 'generates the correct HTML' do
|
239
253
|
with_all_3_dot_x_versions do
|
240
|
-
expect(renderer.navbar_text { 'foo' }).to have_tag(:p, with: { class: 'navbar-text' },
|
254
|
+
expect(renderer.navbar_text { 'foo' }).to have_tag(:p, with: { class: 'navbar-text' }, text: /foo/)
|
241
255
|
end
|
242
256
|
end
|
243
257
|
end
|
@@ -247,7 +261,7 @@ describe BootstrapNavbar::Helpers::Bootstrap3 do
|
|
247
261
|
context 'without parameters' do
|
248
262
|
it 'generates the correct HTML' do
|
249
263
|
with_all_3_dot_x_versions do
|
250
|
-
expect(renderer.navbar_button('foo')).to have_tag(:button, with: { class: 'btn navbar-btn', type: 'button' },
|
264
|
+
expect(renderer.navbar_button('foo')).to have_tag(:button, with: { class: 'btn navbar-btn', type: 'button' }, text: /foo/)
|
251
265
|
end
|
252
266
|
end
|
253
267
|
end
|
@@ -255,7 +269,7 @@ describe BootstrapNavbar::Helpers::Bootstrap3 do
|
|
255
269
|
context 'with "class" parameter' do
|
256
270
|
it 'generates the correct HTML' do
|
257
271
|
with_all_3_dot_x_versions do
|
258
|
-
expect(renderer.navbar_button('foo', class: 'bar')).to have_tag(:button, with: { class: 'btn navbar-btn bar', type: 'button' },
|
272
|
+
expect(renderer.navbar_button('foo', class: 'bar')).to have_tag(:button, with: { class: 'btn navbar-btn bar', type: 'button' }, text: /foo/)
|
259
273
|
end
|
260
274
|
end
|
261
275
|
end
|