From 5182ce64ea0fb2dd5dd9cfd39f2fa3e94c8de7cc Mon Sep 17 00:00:00 2001 From: JoenioCosta Date: Sat, 24 May 2008 19:31:51 +0000 Subject: [PATCH] ActionItem252: fixing functional test --- test/functional/application_controller_test.rb | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index f84d97a..f9891ab 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -127,23 +127,20 @@ class ApplicationControllerTest < Test::Unit::TestCase assert_no_tag :tag => 'div', :attributes => { :id => 'boxes', :class => 'boxes' } end - # FIXME why 'expects' not work??? should 'display only some categories in menu' do - c1 = Environment.default.categories.create!(:name => 'Category 1', :display_color => 1, :parent_id => nil) c2 = Environment.default.categories.create!(:name => 'Category 2', :display_color => nil, :parent_id => c1) - c3 = Environment.default.categories.create!(:name => 'Category 3', :display_color => nil, :parent_id => c1) - - assert_equal [c1], Environment.default.display_categories - assert_equal [c2, c3], c1.all_children - - c2.expects(:display_in_menu?).returns(true) - c3.expects(:display_in_menu?).returns(false) - + Category.any_instance.expects(:display_in_menu?).returns(true) get :index - assert_tag :tag => 'a', :content => /Category 2/ - assert_no_tag :tag => 'a', :content => /Category 3/ + end + + should 'not display some categories in menu' do + c1 = Environment.default.categories.create!(:name => 'Category 1', :display_color => 1, :parent_id => nil) + c2 = Environment.default.categories.create!(:name => 'Category 2', :display_color => nil, :parent_id => c1) + Category.any_instance.expects(:display_in_menu?).returns(false) + get :index + assert_no_tag :tag => 'a', :content => /Category 2/ end end -- libgit2 0.21.2