Commit 521efba05b743e0db851a58c4c48036f79c37412
1 parent
927c6c1b
Exists in
master
and in
22 other branches
ActionItem0: updating tests
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@145 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
19 additions
and
0 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -72,6 +72,7 @@ module ApplicationHelper | @@ -72,6 +72,7 @@ module ApplicationHelper | ||
72 | # TODO: do something more useful here | 72 | # TODO: do something more useful here |
73 | # TODO: test this helper | 73 | # TODO: test this helper |
74 | # TODO: add an icon? | 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 | def virtual_community_identification | 76 | def virtual_community_identification |
76 | content_tag('div', @virtual_community.name, :id => 'virtual_community_identification') | 77 | content_tag('div', @virtual_community.name, :id => 'virtual_community_identification') |
77 | end | 78 | end |
test/functional/application_controller_test.rb
@@ -14,6 +14,11 @@ class ApplicationControllerTest < Test::Unit::TestCase | @@ -14,6 +14,11 @@ class ApplicationControllerTest < Test::Unit::TestCase | ||
14 | @response = ActionController::TestResponse.new | 14 | @response = ActionController::TestResponse.new |
15 | end | 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 | def test_get_against_post_only | 22 | def test_get_against_post_only |
18 | get :post_only | 23 | get :post_only |
19 | assert_redirected_to :action => 'index' | 24 | assert_redirected_to :action => 'index' |
@@ -101,4 +106,11 @@ class ApplicationControllerTest < Test::Unit::TestCase | @@ -101,4 +106,11 @@ class ApplicationControllerTest < Test::Unit::TestCase | ||
101 | }) | 106 | }) |
102 | end | 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 | end | 116 | end |
test/mocks/test/test_controller.rb