Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/helpers/navbar_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def menu_group(options={}, &block)
def menu_item(name=nil, path="#", *args, &block)
path = name || path if block_given?
options = args.extract_options!
content_tag :li, :class => is_active?(path, options) do
content_tag :li, :role => "presentation", :class => is_active?(path, options) do
if block_given?
link_to path, options, &block
else
Expand Down
7 changes: 7 additions & 0 deletions spec/lib/twitter_bootstrap_rails/navbar_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@
with_tag(:a, text: " Home", with: { href: "/"})
}
end

it "should return a link with role 'presentation' attribute" do
allow(self).to receive(:current_page?) { false }

element = menu_item("Home", "/")
expect(element).to have_tag(:li, with: {role: "presentation"})
end
end

describe "drop_down" do
Expand Down