spec/bootstrap-navbar/helpers/bootstrap3_spec.rb in bootstrap-navbar-2.1.1 vs spec/bootstrap-navbar/helpers/bootstrap3_spec.rb in bootstrap-navbar-2.1.2
- old
+ new
@@ -126,9 +126,17 @@
end
describe '#navbar_item' do
it_behaves_like 'marking the navbar items as active correctly'
+ context 'with block' do
+ it 'generates the correct HTML' do
+ expect(renderer.navbar_item('/foo', { class: 'list-item '}, class: 'link') { 'link-text' }).to have_tag(:li, with: { class: 'list-item' }) do
+ with_tag :a, with: { href: '/foo', class: 'link' }, text: /link-text/
+ end
+ end
+ end
+
context 'without current URL' do
it 'generates the correct HTML' do
BootstrapNavbar.configuration.current_url_method = '"/foo"'
expect(renderer.navbar_item('foo', '/')).to have_tag(:li, without: { class: 'active' }) do
with_tag :a, with: { href: '/' }, text: /foo/