Commit 1ec7f711828071d6d49875ac231d979ecdf1ff40
1 parent
7827bc78
Exists in
master
and in
28 other branches
ActionItem114: adding not_found template
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@823 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
4 changed files
with
9 additions
and
10 deletions
Show diff stats
app/controllers/profile_admin/profile_editor_controller.rb
| 1 | 1 | class ProfileEditorController < ProfileAdminController |
| 2 | + protect [:index, :edit], 'edit_profile', :profile | |
| 2 | 3 | helper :profile |
| 3 | 4 | |
| 4 | 5 | needs_profile |
| 5 | 6 | |
| 6 | 7 | design_editor :holder => 'profile', :autosave => true, :block_types => :block_types |
| 7 | 8 | |
| 8 | - protect [:index, :edit], 'edit_profile', :profile | |
| 9 | - | |
| 10 | 9 | def block_types |
| 11 | 10 | { |
| 12 | 11 | 'ListBlock' => _("List of People"), | ... | ... |
test/fixtures/role_assignments.yml
test/functional/profile_editor_controller_test.rb
| ... | ... | @@ -9,16 +9,14 @@ class ProfileEditorControllerTest < Test::Unit::TestCase |
| 9 | 9 | @controller = ProfileEditorController.new |
| 10 | 10 | @request = ActionController::TestRequest.new |
| 11 | 11 | @response = ActionController::TestResponse.new |
| 12 | + login_as('ze') | |
| 12 | 13 | end |
| 13 | 14 | |
| 14 | 15 | def test_index |
| 15 | - profile = Person.new | |
| 16 | - profile.person_info.name = 'a test profile' | |
| 17 | - profile.person_info.address = 'my address' | |
| 18 | - profile.person_info.contact_information = 'my contact information' | |
| 19 | - @controller.instance_variable_set('@profile', profile) | |
| 16 | + profile = Profile.create(:name => 'a test profile', :identifier => 'test_profile') | |
| 20 | 17 | |
| 21 | - get :index, :profile => 'test_profile' | |
| 18 | + get :index, :profile => profile.identifier | |
| 19 | + assert_template :index | |
| 22 | 20 | assert_response :success |
| 23 | 21 | assert_not_nil assigns(:profile) |
| 24 | 22 | ... | ... |