DG MS pushing a small show page fix

This commit is contained in:
maxwell 2010-06-23 15:25:46 -07:00
parent 9d0d8ce5e5
commit fb7ed9e0e7
3 changed files with 18 additions and 8 deletions

View file

@ -7,7 +7,6 @@ class FriendsController < ApplicationController
def show
@friend = Friend.first(:conditions=> {:id => params[:id]})
@friend_posts = @friend.posts
end
def destroy

View file

@ -1,8 +1,11 @@
%h1= "#{@friend.real_name}'s network stream"
%h1= "#{@friend.real_name}'s network stream"
- if @posts
%ul#stream
- for post in @posts
= render type_partial(post), :post => post
- else
%h3 no posts to display!
- if @friend.posts
%ul#stream
- for post in @friend.posts
= render type_partial(post), :post => post
- else
%h3 no posts to display!

View file

@ -5,6 +5,7 @@ describe FriendsController do
before do
#TODO(dan) Mocking Warden; this is a temp fix
request.env['warden'] = mock_model(Warden, :authenticate? => @user, :authenticate! => @user)
Factory.create(:user)
@friend = Factory.build(:friend)
end
@ -48,5 +49,12 @@ describe FriendsController do
it 'should have test that a delete removes a friend from the database' do
end
it 'should display a list of a friends posts on their page' do
friend = Factory.create(:friend)
@status_message = Factory.create(:status_message, :person => friend)
get :show, :id => friend.id
response.body.should include @status_message.message
end
end