Browse files

add spec to check that block passed is executed

  • Loading branch information...
1 parent f997b1e commit 04401c1ebb277c2b733f6e8dc1b505719f61518b @ronalchn ronalchn committed Aug 28, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 spec/lib/simple_navigation/rendering/helpers_spec.rb
View
11 spec/lib/simple_navigation/rendering/helpers_spec.rb
@@ -170,6 +170,17 @@ def whitebox_setup
@controller.render_navigation(:items => @items)
end
end
+ context 'block given' do
+ it 'should use block' do
+ block_executed = 0
+ expect do
+ @controller.render_navigation do |menu|
+ menu.class.should == SimpleNavigation::ItemContainer
+ block_executed += 1
+ end
+ end.to change{block_executed}.by(1)
+ end
+ end
end
describe 'no primary navigation defined' do

0 comments on commit 04401c1

Please sign in to comment.