Commit 342266445edf42cfc5c56067cf47c963f2ad40f4
1 parent
fb8d6743
Exists in
master
and in
22 other branches
ActionItem0: fixing tests
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@114 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
4 changed files
with
36 additions
and
3 deletions
Show diff stats
app/helpers/application_helper.rb
| ... | ... | @@ -55,7 +55,7 @@ module ApplicationHelper |
| 55 | 55 | #Display a given icon passed as argument |
| 56 | 56 | #The icon path should be '/icons/{icons_theme}/{icon_image}' |
| 57 | 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 | 59 | end |
| 60 | 60 | |
| 61 | 61 | # Load all the css files of a existing theme with the theme_name passed as argument. | ... | ... |
app/models/link_block.rb
test/functional/application_controller_test.rb
| ... | ... | @@ -38,4 +38,19 @@ class ApplicationControllerTest < Test::Unit::TestCase |
| 38 | 38 | assert_equal assigns(:chosen_template), 'other' |
| 39 | 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 | 56 | end | ... | ... |
test/functional/edit_template_controller_test.rb
| ... | ... | @@ -11,8 +11,21 @@ class EditTemplateControllerTest < Test::Unit::TestCase |
| 11 | 11 | @response = ActionController::TestResponse.new |
| 12 | 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 | 29 | end |
| 17 | 30 | |
| 18 | 31 | end | ... | ... |