diff --git a/test/unit/application_helper_test.rb b/test/unit/application_helper_test.rb index 307d8b6..e466689 100644 --- a/test/unit/application_helper_test.rb +++ b/test/unit/application_helper_test.rb @@ -14,9 +14,8 @@ class ApplicationHelperTest < Test::Unit::TestCase 'addthis'=>{'pub'=>'mylogin', 'options'=>'favorites, email'}, 'gravatar'=>{'default'=>'wavatar'} } - # does not work! - File.stubs(:exists?).with(yml).returns(true) - YAML.stubs(:load_file).with(yml).returns(conf) + File.expects(:exists?).with(yml).returns(true) + YAML.expects(:load_file).with(yml).returns(conf) assert_equal conf, web2_conf end @@ -531,6 +530,7 @@ class ApplicationHelperTest < Test::Unit::TestCase end should 'generate a gravatar url' do + stubs(:web2_conf).returns({"gravatar" => {"default" => "wavatar"}}) url = str_gravatar_url_for( 'rms@gnu.org', :size => 50 ) assert_match(/^http:\/\/www\.gravatar\.com\/avatar\.php\?/, url) assert_match(/(\?|&)gravatar_id=ed5214d4b49154ba0dc397a28ee90eb7(&|$)/, url) diff --git a/test/unit/communities_block_test.rb b/test/unit/communities_block_test.rb index 5671c6f..967fc73 100644 --- a/test/unit/communities_block_test.rb +++ b/test/unit/communities_block_test.rb @@ -2,6 +2,8 @@ require File.dirname(__FILE__) + '/../test_helper' class CommunitiesBlockTest < Test::Unit::TestCase + include GetText + should 'inherit from ProfileListBlock' do assert_kind_of ProfileListBlock, CommunitiesBlock.new end @@ -50,8 +52,7 @@ class CommunitiesBlockTest < Test::Unit::TestCase block = CommunitiesBlock.new block.expects(:owner).returns(profile) - expects(:__).with('View all').returns('All communities') - expects(:link_to).with('All communities', :controller => 'profile', :profile => 'theprofile', :action => 'communities') + expects(:link_to).with('View all', :controller => 'profile', :profile => 'theprofile', :action => 'communities') instance_eval(&block.footer) end @@ -60,8 +61,7 @@ class CommunitiesBlockTest < Test::Unit::TestCase block = CommunitiesBlock.new block.expects(:owner).returns(env) - expects(:__).with('View all').returns('All communities') - expects(:link_to).with('All communities', :controller => 'search', :action => 'assets', :asset => 'communities') + expects(:link_to).with('View all', :controller => 'search', :action => 'assets', :asset => 'communities') instance_eval(&block.footer) end diff --git a/test/unit/enterprises_block_test.rb b/test/unit/enterprises_block_test.rb index 43ea17c..a052f10 100644 --- a/test/unit/enterprises_block_test.rb +++ b/test/unit/enterprises_block_test.rb @@ -2,6 +2,8 @@ require File.dirname(__FILE__) + '/../test_helper' class EnterprisesBlockTest < Test::Unit::TestCase + include GetText + should 'inherit from ProfileListBlock' do assert_kind_of ProfileListBlock, EnterprisesBlock.new end @@ -75,8 +77,7 @@ class EnterprisesBlockTest < Test::Unit::TestCase block = EnterprisesBlock.new block.expects(:owner).returns(profile) - expects(:__).with('View all').returns('All enterprises') - expects(:link_to).with('All enterprises', :controller => 'profile', :profile => 'theprofile', :action => 'enterprises') + expects(:link_to).with('View all', :controller => 'profile', :profile => 'theprofile', :action => 'enterprises') instance_eval(&block.footer) end @@ -86,8 +87,7 @@ class EnterprisesBlockTest < Test::Unit::TestCase block = EnterprisesBlock.new block.expects(:owner).returns(env) - expects(:__).with('View all').returns('All enterprises') - expects(:link_to).with('All enterprises', :controller => 'search', :action => 'assets', :asset => 'enterprises') + expects(:link_to).with('View all', :controller => 'search', :action => 'assets', :asset => 'enterprises') instance_eval(&block.footer) end diff --git a/test/unit/friends_block_test.rb b/test/unit/friends_block_test.rb index e8dc55d..d7072cb 100644 --- a/test/unit/friends_block_test.rb +++ b/test/unit/friends_block_test.rb @@ -2,6 +2,8 @@ require File.dirname(__FILE__) + '/../test_helper' class FriendsBlockTest < ActiveSupport::TestCase + include GetText + should 'describe itself' do assert_not_equal ProfileListBlock.description, FriendsBlock.description end @@ -39,8 +41,6 @@ class FriendsBlockTest < ActiveSupport::TestCase user.expects(:identifier).returns('theuser') block.expects(:owner).returns(user) - def self._(s); s; end - def self.gettext(s); s; end expects(:link_to).with('View all', :profile => 'theuser', :controller => 'profile', :action => 'friends') instance_eval(&block.footer) -- libgit2 0.21.2