From 521efba05b743e0db851a58c4c48036f79c37412 Mon Sep 17 00:00:00 2001 From: LeandroNunes Date: Wed, 25 Jul 2007 14:07:30 +0000 Subject: [PATCH] ActionItem0: updating tests --- app/helpers/application_helper.rb | 1 + test/functional/application_controller_test.rb | 12 ++++++++++++ test/mocks/test/test_controller.rb | 6 ++++++ 3 files changed, 19 insertions(+), 0 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ef3f434..5ad70b7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -72,6 +72,7 @@ module ApplicationHelper # TODO: do something more useful here # TODO: test this helper # TODO: add an icon? + # TODO: the command rake test:rcov didn't works because of this method. See what it's the problem def virtual_community_identification content_tag('div', @virtual_community.name, :id => 'virtual_community_identification') end diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index 63681df..e3bb0af 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -14,6 +14,11 @@ class ApplicationControllerTest < Test::Unit::TestCase @response = ActionController::TestResponse.new end + def test_exist_virtual_community_variable_to_helper_virtual_community_identification + get :index + assert_not_nil assigns(:virtual_community) + end + def test_get_against_post_only get :post_only assert_redirected_to :action => 'index' @@ -101,4 +106,11 @@ class ApplicationControllerTest < Test::Unit::TestCase }) end + def test_shouldnt_generate_help_box_markup_when_no_block_is_passed + get :help_without_block + assert_no_tag({ + :tag => 'div', + :attributes => { :class => 'help_box'}, + }) + end end diff --git a/test/mocks/test/test_controller.rb b/test/mocks/test/test_controller.rb index 03ad537..9d7138e 100644 --- a/test/mocks/test/test_controller.rb +++ b/test/mocks/test/test_controller.rb @@ -35,4 +35,10 @@ class TestController < ApplicationController ' end + def help_without_block + render :inline => ' + <% help %> + ' + end + end -- libgit2 0.21.2