From 342266445edf42cfc5c56067cf47c963f2ad40f4 Mon Sep 17 00:00:00 2001 From: LeandroNunes Date: Mon, 23 Jul 2007 13:24:27 +0000 Subject: [PATCH] ActionItem0: fixing tests --- app/helpers/application_helper.rb | 2 +- app/models/link_block.rb | 5 +++++ test/functional/application_controller_test.rb | 15 +++++++++++++++ test/functional/edit_template_controller_test.rb | 17 +++++++++++++++-- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cb77098..1814e81 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -55,7 +55,7 @@ module ApplicationHelper #Display a given icon passed as argument #The icon path should be '/icons/{icons_theme}/{icon_image}' def display_icon(icon , icons_theme = "default", options = {}) - image_tag("/icons/#{icons_theme}/#{icon}", options) + image_tag("/icons/#{icons_theme}/#{icon}.png", options) end # Load all the css files of a existing theme with the theme_name passed as argument. diff --git a/app/models/link_block.rb b/app/models/link_block.rb index c6b2fb1..7b50f9e 100644 --- a/app/models/link_block.rb +++ b/app/models/link_block.rb @@ -13,4 +13,9 @@ class LinkBlock < Block end profiles.join(',') end + + def content + profiles = Profile.find(:all) + end + end diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index 20f4c45..0bfc34f 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -38,4 +38,19 @@ class ApplicationControllerTest < Test::Unit::TestCase assert_equal assigns(:chosen_template), 'other' end + def test_exist_owner + get :index + assert_not_nil assigns(:owner) + end + + def test_exist_chosen_theme + get :index + assert_not_nil assigns(:chosen_theme) + end + + def test_exist_chosen_icons_theme + get :index + assert_not_nil assigns(:chosen_icons_theme) + end + end diff --git a/test/functional/edit_template_controller_test.rb b/test/functional/edit_template_controller_test.rb index be17cb2..0c76e07 100644 --- a/test/functional/edit_template_controller_test.rb +++ b/test/functional/edit_template_controller_test.rb @@ -11,8 +11,21 @@ class EditTemplateControllerTest < Test::Unit::TestCase @response = ActionController::TestResponse.new end - def test_truth - assert true + def test_select_theme_html + get :index + available_themes = Dir.new(ApplicationHelper::THEME_DIR_PATH).to_a - ApplicationHelper::REJECTED_DIRS + available_themes.collect do |t| + assert_tag :tag => 'select', :attributes => {:id => 'theme_name', :name => 'theme_name'}, :child => {:tag =>"option", :attributes => {:value => t}} + end + end + + + def test_select_icons_theme_html + get :index + available_icons = Dir.new(ApplicationHelper::ICONS_DIR_PATH).to_a - ApplicationHelper::REJECTED_DIRS + available_icons.collect do |t| + assert_tag :tag => 'select', :attributes => {:id => 'icons_theme_name', :name => 'icons_theme_name'}, :child => {:tag =>"option", :attributes => {:value => t}} + end end end -- libgit2 0.21.2