Commit 342266445edf42cfc5c56067cf47c963f2ad40f4

Authored by LeandroNunes
1 parent fb8d6743

ActionItem0: fixing tests

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@114 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/application_helper.rb
@@ -55,7 +55,7 @@ module ApplicationHelper @@ -55,7 +55,7 @@ module ApplicationHelper
55 #Display a given icon passed as argument 55 #Display a given icon passed as argument
56 #The icon path should be '/icons/{icons_theme}/{icon_image}' 56 #The icon path should be '/icons/{icons_theme}/{icon_image}'
57 def display_icon(icon , icons_theme = "default", options = {}) 57 def display_icon(icon , icons_theme = "default", options = {})
58 - image_tag("/icons/#{icons_theme}/#{icon}", options) 58 + image_tag("/icons/#{icons_theme}/#{icon}.png", options)
59 end 59 end
60 60
61 # Load all the css files of a existing theme with the theme_name passed as argument. 61 # Load all the css files of a existing theme with the theme_name passed as argument.
app/models/link_block.rb
@@ -13,4 +13,9 @@ class LinkBlock < Block @@ -13,4 +13,9 @@ class LinkBlock < Block
13 end 13 end
14 profiles.join(',') 14 profiles.join(',')
15 end 15 end
  16 +
  17 + def content
  18 + profiles = Profile.find(:all)
  19 + end
  20 +
16 end 21 end
test/functional/application_controller_test.rb
@@ -38,4 +38,19 @@ class ApplicationControllerTest < Test::Unit::TestCase @@ -38,4 +38,19 @@ class ApplicationControllerTest < Test::Unit::TestCase
38 assert_equal assigns(:chosen_template), 'other' 38 assert_equal assigns(:chosen_template), 'other'
39 end 39 end
40 40
  41 + def test_exist_owner
  42 + get :index
  43 + assert_not_nil assigns(:owner)
  44 + end
  45 +
  46 + def test_exist_chosen_theme
  47 + get :index
  48 + assert_not_nil assigns(:chosen_theme)
  49 + end
  50 +
  51 + def test_exist_chosen_icons_theme
  52 + get :index
  53 + assert_not_nil assigns(:chosen_icons_theme)
  54 + end
  55 +
41 end 56 end
test/functional/edit_template_controller_test.rb
@@ -11,8 +11,21 @@ class EditTemplateControllerTest < Test::Unit::TestCase @@ -11,8 +11,21 @@ class EditTemplateControllerTest < Test::Unit::TestCase
11 @response = ActionController::TestResponse.new 11 @response = ActionController::TestResponse.new
12 end 12 end
13 13
14 - def test_truth  
15 - assert true 14 + def test_select_theme_html
  15 + get :index
  16 + available_themes = Dir.new(ApplicationHelper::THEME_DIR_PATH).to_a - ApplicationHelper::REJECTED_DIRS
  17 + available_themes.collect do |t|
  18 + assert_tag :tag => 'select', :attributes => {:id => 'theme_name', :name => 'theme_name'}, :child => {:tag =>"option", :attributes => {:value => t}}
  19 + end
  20 + end
  21 +
  22 +
  23 + def test_select_icons_theme_html
  24 + get :index
  25 + available_icons = Dir.new(ApplicationHelper::ICONS_DIR_PATH).to_a - ApplicationHelper::REJECTED_DIRS
  26 + available_icons.collect do |t|
  27 + assert_tag :tag => 'select', :attributes => {:id => 'icons_theme_name', :name => 'icons_theme_name'}, :child => {:tag =>"option", :attributes => {:value => t}}
  28 + end
16 end 29 end
17 30
18 end 31 end