Commit 706a1c39f42767bd4543e758eae609509b337236
1 parent
dc758973
Exists in
master
and in
29 other branches
ActionItem36: listing friends in /profile/${user}
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1489 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
15 additions
and
3 deletions
Show diff stats
app/controllers/public/profile_controller.rb
@@ -20,4 +20,8 @@ class ProfileController < ApplicationController | @@ -20,4 +20,8 @@ class ProfileController < ApplicationController | ||
20 | @enterprises = profile.enterprises | 20 | @enterprises = profile.enterprises |
21 | end | 21 | end |
22 | 22 | ||
23 | + def friends | ||
24 | + @friends= profile.friends | ||
25 | + end | ||
26 | + | ||
23 | end | 27 | end |
test/functional/profile_controller_test.rb
@@ -9,10 +9,18 @@ class ProfileControllerTest < Test::Unit::TestCase | @@ -9,10 +9,18 @@ class ProfileControllerTest < Test::Unit::TestCase | ||
9 | @controller = ProfileController.new | 9 | @controller = ProfileController.new |
10 | @request = ActionController::TestRequest.new | 10 | @request = ActionController::TestRequest.new |
11 | @response = ActionController::TestResponse.new | 11 | @response = ActionController::TestResponse.new |
12 | + | ||
13 | + @profile = create_user('testuser').person | ||
12 | end | 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 | end | 24 | end |
25 | + | ||
18 | end | 26 | end |