From 1ec7f711828071d6d49875ac231d979ecdf1ff40 Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Wed, 24 Oct 2007 12:06:35 +0000 Subject: [PATCH] ActionItem114: adding not_found template --- app/controllers/profile_admin/profile_editor_controller.rb | 3 +-- app/views/shared/not_found.rhtml | 2 ++ test/fixtures/role_assignments.yml | 4 ++-- test/functional/profile_editor_controller_test.rb | 10 ++++------ 4 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 app/views/shared/not_found.rhtml diff --git a/app/controllers/profile_admin/profile_editor_controller.rb b/app/controllers/profile_admin/profile_editor_controller.rb index 59d9259..02f1fe4 100644 --- a/app/controllers/profile_admin/profile_editor_controller.rb +++ b/app/controllers/profile_admin/profile_editor_controller.rb @@ -1,12 +1,11 @@ class ProfileEditorController < ProfileAdminController + protect [:index, :edit], 'edit_profile', :profile helper :profile needs_profile design_editor :holder => 'profile', :autosave => true, :block_types => :block_types - protect [:index, :edit], 'edit_profile', :profile - def block_types { 'ListBlock' => _("List of People"), diff --git a/app/views/shared/not_found.rhtml b/app/views/shared/not_found.rhtml new file mode 100644 index 0000000..09acf46 --- /dev/null +++ b/app/views/shared/not_found.rhtml @@ -0,0 +1,2 @@ +

<%= _('There is no such page: %s') % (content_tag('tt', @path)) %>

+ diff --git a/test/fixtures/role_assignments.yml b/test/fixtures/role_assignments.yml index a006485..b18ffe3 100644 --- a/test/fixtures/role_assignments.yml +++ b/test/fixtures/role_assignments.yml @@ -4,8 +4,8 @@ one: accessor_id: 4 accessor_type: 'Profile' role_id: 2 - resource_id: 5 - resource_type: 'Profile' + resource_id: 1 + resource_type: 'Environment' two: id: 2 accessor_id: 1 diff --git a/test/functional/profile_editor_controller_test.rb b/test/functional/profile_editor_controller_test.rb index 764f700..882eff3 100644 --- a/test/functional/profile_editor_controller_test.rb +++ b/test/functional/profile_editor_controller_test.rb @@ -9,16 +9,14 @@ class ProfileEditorControllerTest < Test::Unit::TestCase @controller = ProfileEditorController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new + login_as('ze') end def test_index - profile = Person.new - profile.person_info.name = 'a test profile' - profile.person_info.address = 'my address' - profile.person_info.contact_information = 'my contact information' - @controller.instance_variable_set('@profile', profile) + profile = Profile.create(:name => 'a test profile', :identifier => 'test_profile') - get :index, :profile => 'test_profile' + get :index, :profile => profile.identifier + assert_template :index assert_response :success assert_not_nil assigns(:profile) -- libgit2 0.21.2