Commit a03718fe2765e14a3f7e08271f669aa3cea6b711

Authored by AntonioTerceiro
1 parent be044cf3

ActionItem280: fixing test and helper


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1748 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/profile_helper.rb
@@ -8,7 +8,7 @@ module ProfileHelper @@ -8,7 +8,7 @@ module ProfileHelper
8 table_rows = content_tag( 'tr', 8 table_rows = content_tag( 'tr',
9 content_tag( 'th', 9 content_tag( 'th',
10 "\n" + 10 "\n" +
11 - button( :edit, _('edit your informations'), :controller => 'profile_editor', :action => 'edit' ) + 11 + button( :edit, _('edit your information'), :controller => 'profile_editor', :action => 'edit' ) +
12 "\n", 12 "\n",
13 :colspan => 2, :class => 'header' ) 13 :colspan => 2, :class => 'header' )
14 ) + "\n" 14 ) + "\n"
test/unit/profile_helper_test.rb
@@ -31,15 +31,13 @@ class ProfileHelperTest < Test::Unit::TestCase @@ -31,15 +31,13 @@ class ProfileHelperTest < Test::Unit::TestCase
31 info.expects(:summary).returns(array) 31 info.expects(:summary).returns(array)
32 profile.stubs(:info).returns(info) 32 profile.stubs(:info).returns(info)
33 33
34 - helper.expects(:content_tag).with('th', f1).returns(f1)  
35 - helper.expects(:content_tag).with('td', v1).returns(v1)  
36 - helper.expects(:content_tag).with('tr', f1 + v1).returns('r1')  
37 - helper.expects(:content_tag).with('th', f2).returns(f2)  
38 - helper.expects(:content_tag).with('td', v2).returns(v2)  
39 - helper.expects(:content_tag).with('tr', f2 + v2).returns('r2')  
40 - helper.expects(:content_tag).with('table', "r1\nr2\n", :class => 'profile_info' ).returns('final')  
41 -  
42 - assert_equal 'final', helper.display_profile_info(profile) 34 + helper.expects(:content_tag).returns('').at_least_once
  35 +
  36 + helper.expects(:_).with('edit your information').returns('edit your information')
  37 + helper.expects(:button).with(:edit, 'edit your information', :controller => 'profile_editor', :action => 'edit').returns("BUTTON")
  38 +
  39 +
  40 + helper.display_profile_info(profile)
43 end 41 end
44 42
45 def test_should_call_blocks 43 def test_should_call_blocks