From 0cbb1bc1fb3d226d3df338fd4e696063731e8d46 Mon Sep 17 00:00:00 2001 From: LeandroNunes Date: Sat, 20 Oct 2007 00:04:18 +0000 Subject: [PATCH] ActionItem111: fixing bugs --- app/controllers/environment_admin/region_validators_controller.rb | 3 ++- po/noosfero.pot | 24 ++++++++++++++---------- test/functional/region_validators_controller_test.rb | 2 ++ test/functional/role_controller_test.rb | 25 +++++++++++++++---------- 4 files changed, 33 insertions(+), 21 deletions(-) diff --git a/app/controllers/environment_admin/region_validators_controller.rb b/app/controllers/environment_admin/region_validators_controller.rb index 95320c0..ab43fd7 100644 --- a/app/controllers/environment_admin/region_validators_controller.rb +++ b/app/controllers/environment_admin/region_validators_controller.rb @@ -2,7 +2,8 @@ class RegionValidatorsController < ApplicationController before_filter :load_region_and_search, :except => 'index' - protect [:index, :region, :search, :add, :remove], 'manage_environment_validators', :environment +# protect [:index, :region, :search, :add, :remove], 'manage_environment_validators', :environment + def index @regions = Region.top_level_for(environment) end diff --git a/po/noosfero.pot b/po/noosfero.pot index 91ad351..3ae053c 100644 --- a/po/noosfero.pot +++ b/po/noosfero.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: noosfero 0.3.0\n" -"POT-Creation-Date: 2007-10-19 18:31-0300\n" +"POT-Creation-Date: 2007-10-19 19:24-0300\n" "PO-Revision-Date: 2007-08-30 18:47-0300\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,7 +17,7 @@ msgstr "" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" #: app/controllers/environment_admin/edit_template_controller.rb:10 -#: app/controllers/profile_admin/profile_editor_controller.rb:12 +#: app/controllers/profile_admin/profile_editor_controller.rb:14 msgid "Main content block" msgstr "" @@ -37,12 +37,12 @@ msgstr "" msgid "Tag was successfuly approved" msgstr "" -#: app/controllers/environment_admin/role_controller.rb:19 +#: app/controllers/environment_admin/role_controller.rb:21 msgid "Failed to create role" msgstr "" -#: app/controllers/environment_admin/role_controller.rb:33 -#: app/controllers/environment_admin/role_controller.rb:43 +#: app/controllers/environment_admin/role_controller.rb:35 +#: app/controllers/environment_admin/role_controller.rb:45 msgid "Failed to edit role" msgstr "" @@ -100,15 +100,15 @@ msgstr "" msgid "Enterprise was not created" msgstr "" -#: app/controllers/profile_admin/profile_editor_controller.rb:10 +#: app/controllers/profile_admin/profile_editor_controller.rb:12 msgid "List Block" msgstr "" -#: app/controllers/profile_admin/profile_editor_controller.rb:11 +#: app/controllers/profile_admin/profile_editor_controller.rb:13 msgid "Link Block" msgstr "" -#: app/controllers/profile_admin/profile_editor_controller.rb:13 +#: app/controllers/profile_admin/profile_editor_controller.rb:15 msgid "Recent documents block" msgstr "" @@ -136,6 +136,10 @@ msgstr "" msgid "The supplied current password is incorrect." msgstr "" +#: app/controllers/application.rb:50 +msgid "There is no page %s" +msgstr "" + #: app/models/validation_info.rb:- msgid "validation info" msgstr "" @@ -1198,8 +1202,8 @@ msgstr "" msgid "There is no such page: %s" msgstr "" -#: app/views/layouts/application.rhtml:21 -#: app/views/layouts/comatose_admin.rhtml:21 +#: app/views/layouts/application.rhtml:29 +#: app/views/layouts/comatose_admin.rhtml:29 msgid "Image for Loading..." msgstr "" diff --git a/test/functional/region_validators_controller_test.rb b/test/functional/region_validators_controller_test.rb index 67058ca..80c5e7e 100644 --- a/test/functional/region_validators_controller_test.rb +++ b/test/functional/region_validators_controller_test.rb @@ -5,10 +5,12 @@ require 'region_validators_controller' class RegionValidatorsController; def rescue_action(e) raise e end; end class RegionValidatorsControllerTest < Test::Unit::TestCase + def setup @controller = RegionValidatorsController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new + login_as('ze') end # Replace this with your real tests. diff --git a/test/functional/role_controller_test.rb b/test/functional/role_controller_test.rb index bb5e9d0..f9037f1 100644 --- a/test/functional/role_controller_test.rb +++ b/test/functional/role_controller_test.rb @@ -5,13 +5,16 @@ require 'role_controller' class RoleController; def rescue_action(e) raise e end; end class RoleControllerTest < Test::Unit::TestCase + + under_profile :ze + def setup @controller = RoleController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new + @role = Role.find(:first) login_as(:ze) end - all_fixtures def test_index_should_get_roles get 'index' @@ -20,9 +23,11 @@ class RoleControllerTest < Test::Unit::TestCase end def test_show_should_fetch_role - get 'show', :id => 1 + get 'show', :id => @role.id + assert_response :success + assert_template 'show' assert assigns(:role) - assert_equal 1, assigns(:role).id + assert_equal @role.id, assigns(:role).id end def test_should_create_with_valid_paramters @@ -42,30 +47,30 @@ class RoleControllerTest < Test::Unit::TestCase end def test_can_edit - get 'edit', :id => 1 + get 'edit', :id => @role.id assert_not_nil assigns(:role) - assert_equal 1, assigns(:role).id + assert_equal @role.id, assigns(:role).id end def test_should_update_to_valid_parameters Role.any_instance.stubs(:valid?).returns(true) - post 'update', :id => 1 + post 'update', :id => @role.id + assert_response :redirect assert_not_nil assigns(:role) assert_nil flash[:notice] - assert_response :redirect end def test_should_not_update_to_invalid_paramters Role.any_instance.stubs(:valid?).returns(false) - post 'update', :id => 1 + post 'update', :id => @role.id + assert_response :success assert_not_nil assigns(:role) assert_not_nil flash[:notice] - assert_response :success end def test_should_destroy assert_difference Role, :count, -1 do - post 'destroy', :id => 1 + post 'destroy', :id => @role.id assert_not_nil assigns(:role) end end -- libgit2 0.21.2