Permalink
Browse files

make test suite compatible with 1.9.2

  • Loading branch information...
1 parent db3caf1 commit d2baa97eba90a81c1dafd56bffb7464a86d24647 @danielvlopes committed Jun 6, 2011
Showing with 20 additions and 20 deletions.
  1. +20 −20 test/helper_test.rb
View
@@ -6,9 +6,9 @@ class HelperTest < ActionView::TestCase
attr_accessor :controller, :request
test "menu yields an instance of Menu" do
- concat(menu do |m|
+ concat(menu { |m|
assert m.instance_of?(MenuBuilder::ViewHelpers::Menu)
- end)
+ })
end
test "menu create an unordered list" do
@@ -17,7 +17,7 @@ class HelperTest < ActionView::TestCase
end
test "menu accept html options like classes and id" do
- concat(menu :id=>"menu", :class=>"tabs" do |m| end)
+ concat(menu(:id=>"menu", :class=>"tabs") { |m| })
assert_select "ul#menu.tabs"
end
@@ -33,66 +33,66 @@ class HelperTest < ActionView::TestCase
test "set the class to the current item li" do
@menu_items = [:home]
- concat(menu do |m|
+ concat(menu { |m|
concat m.home "Home", "/"
concat m.contact "Store", "/store"
- end)
+ })
assert_select "li.current", 1
end
test "accept more than one menu item" do
@menu_items = [:settings, :notifications]
- concat(menu do |m|
+ concat(menu { |m|
concat m.home "Home", "/"
concat m.notifications "Notifications", "/notifications"
concat m.settings "Settings", "/settings"
- end)
+ })
assert_select "li.current", 2
end
test "accept more than one menu" do
@menu_items = [:settings, :notifications]
- concat(menu do |m|
+ concat(menu { |m|
concat m.home "Home", "/"
concat m.notifications "Notifications", "/notifications"
- end)
+ })
- concat(menu do |m|
+ concat(menu { |m|
concat m.home "Contact", "/contact"
concat m.notifications "Settings", "/settings"
- end)
+ })
assert_select "li.current", 2
end
test "marks the first item with class .first" do
- concat(menu do |m|
+ concat(menu { |m|
concat m.home "Home", "/"
concat m.contact "Store", "/store"
- end)
+ })
assert_select "li.first", 1
end
test 'marks the last item with class .last' do
- concat(menu do |m|
+ concat(menu { |m|
concat m.home "Home", "/"
concat m.contact "Store", "/store"
concat m.notifications "Settings", "/settings"
- end)
+ })
assert_select "li.last", 1
end
test "pass a block to an item" do
- concat(menu do |m|
- concat(m.account "/account" do
+ concat(menu { |m|
+ concat(m.account("/account") {
concat tag(:img, nil, { :src => 'icon.jpg' })
- end)
- end)
+ })
+ })
- assert_select "ul > li > a > img"
+ assert_select "ul > li > a > img"
end
end

0 comments on commit d2baa97

Please sign in to comment.