Fix photo show pages with likes

This commit is contained in:
Raphael Sofaer 2011-08-02 10:16:11 -07:00
parent b9120fca80
commit be5453f0b4
2 changed files with 12 additions and 5 deletions

View file

@ -66,5 +66,5 @@
#photo_stream.stream.show
%div{:data=>{:guid=>parent.id}}
.likes_container
= render "likes/likes_container", :post_id => parent.id, :likes_count => parent.likes_count
= render "likes/likes_container", :post_id => parent.id, :target_type => 'Post', :likes_count => parent.likes_count
= render "comments/comments", :post => parent, :comments => parent.comments, :always_expanded => true

View file

@ -65,18 +65,25 @@ describe PhotosController do
end
context "private photo user can see" do
before do
get :show, :id => @bobs_photo.id
end
it "succeeds" do
get :show, :id => @bobs_photo.id
response.should be_success
end
it "assigns the photo" do
get :show, :id => @bobs_photo.id
assigns[:photo].should == @bobs_photo
@controller.ownership.should be_false
end
it 'succeeds with a like present' do
sm = bob.post(:status_message, :text => 'parent post', :to => 'all')
@bobs_photo.status_message_guid = sm.guid
@bobs_photo.save!
alice.like(1, :target => @bobs_photo.status_message)
get :show, :id => @bobs_photo.id
response.should be_success
end
end
context "private photo user cannot see" do