Commit 5182ce64ea0fb2dd5dd9cfd39f2fa3e94c8de7cc
1 parent
6d3180c2
Exists in
staging
and in
42 other branches
ActionItem252: fixing functional test
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1834 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
9 additions
and
12 deletions
Show diff stats
test/functional/application_controller_test.rb
@@ -127,23 +127,20 @@ class ApplicationControllerTest < Test::Unit::TestCase | @@ -127,23 +127,20 @@ class ApplicationControllerTest < Test::Unit::TestCase | ||
127 | assert_no_tag :tag => 'div', :attributes => { :id => 'boxes', :class => 'boxes' } | 127 | assert_no_tag :tag => 'div', :attributes => { :id => 'boxes', :class => 'boxes' } |
128 | end | 128 | end |
129 | 129 | ||
130 | - # FIXME why 'expects' not work??? | ||
131 | should 'display only some categories in menu' do | 130 | should 'display only some categories in menu' do |
132 | - | ||
133 | c1 = Environment.default.categories.create!(:name => 'Category 1', :display_color => 1, :parent_id => nil) | 131 | c1 = Environment.default.categories.create!(:name => 'Category 1', :display_color => 1, :parent_id => nil) |
134 | c2 = Environment.default.categories.create!(:name => 'Category 2', :display_color => nil, :parent_id => c1) | 132 | c2 = Environment.default.categories.create!(:name => 'Category 2', :display_color => nil, :parent_id => c1) |
135 | - c3 = Environment.default.categories.create!(:name => 'Category 3', :display_color => nil, :parent_id => c1) | ||
136 | - | ||
137 | - assert_equal [c1], Environment.default.display_categories | ||
138 | - assert_equal [c2, c3], c1.all_children | ||
139 | - | ||
140 | - c2.expects(:display_in_menu?).returns(true) | ||
141 | - c3.expects(:display_in_menu?).returns(false) | ||
142 | - | 133 | + Category.any_instance.expects(:display_in_menu?).returns(true) |
143 | get :index | 134 | get :index |
144 | - | ||
145 | assert_tag :tag => 'a', :content => /Category 2/ | 135 | assert_tag :tag => 'a', :content => /Category 2/ |
146 | - assert_no_tag :tag => 'a', :content => /Category 3/ | 136 | + end |
137 | + | ||
138 | + should 'not display some categories in menu' do | ||
139 | + c1 = Environment.default.categories.create!(:name => 'Category 1', :display_color => 1, :parent_id => nil) | ||
140 | + c2 = Environment.default.categories.create!(:name => 'Category 2', :display_color => nil, :parent_id => c1) | ||
141 | + Category.any_instance.expects(:display_in_menu?).returns(false) | ||
142 | + get :index | ||
143 | + assert_no_tag :tag => 'a', :content => /Category 2/ | ||
147 | end | 144 | end |
148 | 145 | ||
149 | end | 146 | end |