switch PhotosController#index over to guid, fix #2729

This commit is contained in:
Jonne Haß 2012-01-25 12:20:02 +01:00
parent 9c67cd7eb9
commit e1658f8d8b
2 changed files with 4 additions and 4 deletions

View file

@ -11,7 +11,7 @@ class PhotosController < ApplicationController
def index
@post_type = :photos
@person = Person.find_by_id(params[:person_id])
@person = Person.find_by_guid(params[:person_id])
if @person
@profile = @person.profile

View file

@ -64,19 +64,19 @@ describe PhotosController do
describe '#index' do
it "succeeds without any available pictures" do
get :index, :person_id => Factory(:person).id.to_s
get :index, :person_id => Factory(:person).guid.to_s
response.should be_success
end
it "displays the logged in user's pictures" do
get :index, :person_id => alice.person.id.to_s
get :index, :person_id => alice.person.guid.to_s
assigns[:person].should == alice.person
assigns[:posts].should == [@alices_photo]
end
it "displays another person's pictures" do
get :index, :person_id => bob.person.id.to_s
get :index, :person_id => bob.person.guid.to_s
assigns[:person].should == bob.person
assigns[:posts].should == [@bobs_photo]
end