Commit 706a1c39f42767bd4543e758eae609509b337236

Authored by AntonioTerceiro
1 parent dc758973

ActionItem36: listing friends in /profile/${user}


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1489 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/public/profile_controller.rb
... ... @@ -20,4 +20,8 @@ class ProfileController < ApplicationController
20 20 @enterprises = profile.enterprises
21 21 end
22 22  
  23 + def friends
  24 + @friends= profile.friends
  25 + end
  26 +
23 27 end
... ...
test/functional/profile_controller_test.rb
... ... @@ -9,10 +9,18 @@ class ProfileControllerTest < Test::Unit::TestCase
9 9 @controller = ProfileController.new
10 10 @request = ActionController::TestRequest.new
11 11 @response = ActionController::TestResponse.new
  12 +
  13 + @profile = create_user('testuser').person
12 14 end
13 15  
14   - # Replace this with your real tests.
15   - def test_truth
16   - assert true
  16 + noosfero_test :profile => 'testuser'
  17 +
  18 + should 'list friends' do
  19 + get :friends
  20 +
  21 + assert_response :success
  22 + assert_template 'friends'
  23 + assert_kind_of Array, assigns(:friends)
17 24 end
  25 +
18 26 end
... ...