From a03718fe2765e14a3f7e08271f669aa3cea6b711 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Tue, 29 Apr 2008 20:44:01 +0000 Subject: [PATCH] ActionItem280: fixing test and helper --- app/helpers/profile_helper.rb | 2 +- test/unit/profile_helper_test.rb | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/helpers/profile_helper.rb b/app/helpers/profile_helper.rb index 938c228..e1fc993 100644 --- a/app/helpers/profile_helper.rb +++ b/app/helpers/profile_helper.rb @@ -8,7 +8,7 @@ module ProfileHelper table_rows = content_tag( 'tr', content_tag( 'th', "\n" + - button( :edit, _('edit your informations'), :controller => 'profile_editor', :action => 'edit' ) + + button( :edit, _('edit your information'), :controller => 'profile_editor', :action => 'edit' ) + "\n", :colspan => 2, :class => 'header' ) ) + "\n" diff --git a/test/unit/profile_helper_test.rb b/test/unit/profile_helper_test.rb index 0f0f29e..7e658a1 100644 --- a/test/unit/profile_helper_test.rb +++ b/test/unit/profile_helper_test.rb @@ -31,15 +31,13 @@ class ProfileHelperTest < Test::Unit::TestCase info.expects(:summary).returns(array) profile.stubs(:info).returns(info) - helper.expects(:content_tag).with('th', f1).returns(f1) - helper.expects(:content_tag).with('td', v1).returns(v1) - helper.expects(:content_tag).with('tr', f1 + v1).returns('r1') - helper.expects(:content_tag).with('th', f2).returns(f2) - helper.expects(:content_tag).with('td', v2).returns(v2) - helper.expects(:content_tag).with('tr', f2 + v2).returns('r2') - helper.expects(:content_tag).with('table', "r1\nr2\n", :class => 'profile_info' ).returns('final') - - assert_equal 'final', helper.display_profile_info(profile) + helper.expects(:content_tag).returns('').at_least_once + + helper.expects(:_).with('edit your information').returns('edit your information') + helper.expects(:button).with(:edit, 'edit your information', :controller => 'profile_editor', :action => 'edit').returns("BUTTON") + + + helper.display_profile_info(profile) end def test_should_call_blocks -- libgit2 0.21.2