Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rename :preceding_text option to :prefix

  • Loading branch information...
commit acb6ca1ef8b5fa5848ae780af375bf603a92a951 1 parent 3a803f0
@rodrigomanhaes rodrigomanhaes authored
View
6 lib/simple_navigation/rendering/renderer/breadcrumbs.rb
@@ -13,7 +13,7 @@ class Breadcrumbs < SimpleNavigation::Renderer::Base
def render(item_container)
content = a_tags(item_container).join(join_with)
content_tag(:div,
- preceding_text_for(content) + content,
+ prefix_for(content) + content,
{:id => item_container.dom_id, :class => item_container.dom_class})
end
@@ -39,8 +39,8 @@ def suppress_link?(item)
super || (options[:static_leaf] && item.active_leaf_class)
end
- def preceding_text_for(content)
- content.empty? ? '' : options[:preceding_text] || ''
+ def prefix_for(content)
+ content.empty? ? '' : options[:prefix] || ''
end
# Extracts the options relevant for the generated link
View
10 spec/lib/simple_navigation/rendering/renderer/breadcrumbs_spec.rb
@@ -59,17 +59,17 @@ def render(current_nav=nil, options={:level => :all})
end
end
- context 'with preceding_text option' do
- it 'should render preceding text before breadcrumbs' do
- selection = HTML::Selector.new('div').select(render(:subnav1, :level => :all, :preceding_text => 'You are here: '))
+ context 'with prefix option' do
+ it 'should render prefix before breadcrumbs' do
+ selection = HTML::Selector.new('div').select(render(:subnav1, :level => :all, :prefix => 'You are here: '))
raise unless selection.count == 1
tag = selection.first
tag.to_s.should =~ /^\<div.+\>You are here\: /
end
- it 'should not render preceding text if there is no available breadcrumb' do
+ it 'should not render prefix if there is no available breadcrumb' do
allow_message_expectations_on_nil
- selection = HTML::Selector.new('div').select(render('', :preceding_text => 'You are here: '))
+ selection = HTML::Selector.new('div').select(render('', :prefix => 'You are here: '))
tag = selection.first
tag.to_s.should =~ /^\<div.+\>\<\/div\>/
end
Please sign in to comment.
Something went wrong with that request. Please try again.