diff --git a/app/controllers/public/profile_controller.rb b/app/controllers/public/profile_controller.rb index f7d25a5..25cec3b 100644 --- a/app/controllers/public/profile_controller.rb +++ b/app/controllers/public/profile_controller.rb @@ -20,4 +20,8 @@ class ProfileController < ApplicationController @enterprises = profile.enterprises end + def friends + @friends= profile.friends + end + end diff --git a/test/functional/profile_controller_test.rb b/test/functional/profile_controller_test.rb index 623b592..94b9a0b 100644 --- a/test/functional/profile_controller_test.rb +++ b/test/functional/profile_controller_test.rb @@ -9,10 +9,18 @@ class ProfileControllerTest < Test::Unit::TestCase @controller = ProfileController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new + + @profile = create_user('testuser').person end - # Replace this with your real tests. - def test_truth - assert true + noosfero_test :profile => 'testuser' + + should 'list friends' do + get :friends + + assert_response :success + assert_template 'friends' + assert_kind_of Array, assigns(:friends) end + end -- libgit2 0.21.2