Commit 93fdfc16e192015784e533099b5b9bd0b50c51e2

Authored by AntonioTerceiro
1 parent d0444d5a

ActionItem523: mocking the new method



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2313 3f533792-8f58-4932-b0fe-aaf55b0a4547
test/unit/assets_helper_test.rb
@@ -19,6 +19,7 @@ class AssetsHelperTest < Test::Unit::TestCase @@ -19,6 +19,7 @@ class AssetsHelperTest < Test::Unit::TestCase
19 end 19 end
20 20
21 stubs(:_).returns('') 21 stubs(:_).returns('')
  22 + stubs(:__).returns('')
22 stubs(:content_tag).returns('') 23 stubs(:content_tag).returns('')
23 generate_assets_menu 24 generate_assets_menu
24 end 25 end
@@ -38,6 +39,7 @@ class AssetsHelperTest < Test::Unit::TestCase @@ -38,6 +39,7 @@ class AssetsHelperTest < Test::Unit::TestCase
38 end 39 end
39 40
40 stubs(:_).returns('') 41 stubs(:_).returns('')
  42 + stubs(:__).returns('')
41 stubs(:content_tag).returns('') 43 stubs(:content_tag).returns('')
42 @category = mock 44 @category = mock
43 @category.expects(:explode_path).returns(['my-category']).at_least_once 45 @category.expects(:explode_path).returns(['my-category']).at_least_once
@@ -65,6 +67,7 @@ class AssetsHelperTest < Test::Unit::TestCase @@ -65,6 +67,7 @@ class AssetsHelperTest < Test::Unit::TestCase
65 expects(:link_to).with(anything, { :controller => 'search', :action => 'assets', :asset => 'enterprises', :category_path => [ 'my-category' ]}).never 67 expects(:link_to).with(anything, { :controller => 'search', :action => 'assets', :asset => 'enterprises', :category_path => [ 'my-category' ]}).never
66 68
67 stubs(:_).returns('') 69 stubs(:_).returns('')
  70 + stubs(:__).returns('')
68 stubs(:content_tag).returns('') 71 stubs(:content_tag).returns('')
69 @category = mock 72 @category = mock
70 @category.expects(:explode_path).returns(['my-category']).at_least_once 73 @category.expects(:explode_path).returns(['my-category']).at_least_once
test/unit/communities_block_test.rb
@@ -49,7 +49,7 @@ class CommunitiesBlockTest < Test::Unit::TestCase @@ -49,7 +49,7 @@ class CommunitiesBlockTest < Test::Unit::TestCase
49 block = CommunitiesBlock.new 49 block = CommunitiesBlock.new
50 block.expects(:owner).returns(profile) 50 block.expects(:owner).returns(profile)
51 51
52 - expects(:_).with('All communities').returns('All communities') 52 + expects(:__).with('All communities').returns('All communities')
53 expects(:link_to).with('All communities', :controller => 'profile', :profile => 'theprofile', :action => 'communities') 53 expects(:link_to).with('All communities', :controller => 'profile', :profile => 'theprofile', :action => 'communities')
54 instance_eval(&block.footer) 54 instance_eval(&block.footer)
55 end 55 end
@@ -59,7 +59,7 @@ class CommunitiesBlockTest < Test::Unit::TestCase @@ -59,7 +59,7 @@ class CommunitiesBlockTest < Test::Unit::TestCase
59 block = CommunitiesBlock.new 59 block = CommunitiesBlock.new
60 block.expects(:owner).returns(env) 60 block.expects(:owner).returns(env)
61 61
62 - expects(:_).with('All communities').returns('All communities') 62 + expects(:__).with('All communities').returns('All communities')
63 expects(:link_to).with('All communities', :controller => 'search', :action => 'assets', :asset => 'communities') 63 expects(:link_to).with('All communities', :controller => 'search', :action => 'assets', :asset => 'communities')
64 64
65 instance_eval(&block.footer) 65 instance_eval(&block.footer)
test/unit/enterprises_block_test.rb
@@ -48,7 +48,7 @@ class EnterprisesBlockTest < Test::Unit::TestCase @@ -48,7 +48,7 @@ class EnterprisesBlockTest < Test::Unit::TestCase
48 block = EnterprisesBlock.new 48 block = EnterprisesBlock.new
49 block.expects(:owner).returns(profile) 49 block.expects(:owner).returns(profile)
50 50
51 - expects(:_).with('All enterprises').returns('All enterprises') 51 + expects(:__).with('All enterprises').returns('All enterprises')
52 expects(:link_to).with('All enterprises', :controller => 'profile', :profile => 'theprofile', :action => 'enterprises') 52 expects(:link_to).with('All enterprises', :controller => 'profile', :profile => 'theprofile', :action => 'enterprises')
53 53
54 instance_eval(&block.footer) 54 instance_eval(&block.footer)
@@ -59,7 +59,7 @@ class EnterprisesBlockTest < Test::Unit::TestCase @@ -59,7 +59,7 @@ class EnterprisesBlockTest < Test::Unit::TestCase
59 block = EnterprisesBlock.new 59 block = EnterprisesBlock.new
60 block.expects(:owner).returns(env) 60 block.expects(:owner).returns(env)
61 61
62 - expects(:_).with('All enterprises').returns('All enterprises') 62 + expects(:__).with('All enterprises').returns('All enterprises')
63 expects(:link_to).with('All enterprises', :controller => 'search', :action => 'assets', :asset => 'enterprises') 63 expects(:link_to).with('All enterprises', :controller => 'search', :action => 'assets', :asset => 'enterprises')
64 instance_eval(&block.footer) 64 instance_eval(&block.footer)
65 end 65 end