Commit 521efba05b743e0db851a58c4c48036f79c37412

Authored by LeandroNunes
1 parent 927c6c1b

ActionItem0: updating tests

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@145 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/application_helper.rb
... ... @@ -72,6 +72,7 @@ module ApplicationHelper
72 72 # TODO: do something more useful here
73 73 # TODO: test this helper
74 74 # TODO: add an icon?
  75 + # TODO: the command rake test:rcov didn't works because of this method. See what it's the problem
75 76 def virtual_community_identification
76 77 content_tag('div', @virtual_community.name, :id => 'virtual_community_identification')
77 78 end
... ...
test/functional/application_controller_test.rb
... ... @@ -14,6 +14,11 @@ class ApplicationControllerTest < Test::Unit::TestCase
14 14 @response = ActionController::TestResponse.new
15 15 end
16 16  
  17 + def test_exist_virtual_community_variable_to_helper_virtual_community_identification
  18 + get :index
  19 + assert_not_nil assigns(:virtual_community)
  20 + end
  21 +
17 22 def test_get_against_post_only
18 23 get :post_only
19 24 assert_redirected_to :action => 'index'
... ... @@ -101,4 +106,11 @@ class ApplicationControllerTest < Test::Unit::TestCase
101 106 })
102 107 end
103 108  
  109 + def test_shouldnt_generate_help_box_markup_when_no_block_is_passed
  110 + get :help_without_block
  111 + assert_no_tag({
  112 + :tag => 'div',
  113 + :attributes => { :class => 'help_box'},
  114 + })
  115 + end
104 116 end
... ...
test/mocks/test/test_controller.rb
... ... @@ -35,4 +35,10 @@ class TestController < ApplicationController
35 35 '
36 36 end
37 37  
  38 + def help_without_block
  39 + render :inline => '
  40 + <% help %>
  41 + '
  42 + end
  43 +
38 44 end
... ...