From e1658f8d8b9f6d439340da77377974cecd2b48aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Wed, 25 Jan 2012 12:20:02 +0100 Subject: [PATCH] switch PhotosController#index over to guid, fix #2729 --- app/controllers/photos_controller.rb | 2 +- spec/controllers/photos_controller_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index d8473fa1b..339848d33 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -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 diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index f2d90e5f6..6893dff4a 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -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