From 55952d00c03102aaa9a8e595212890aeb110a8a8 Mon Sep 17 00:00:00 2001
From: danielvincent <danielgrippi@gmail.com>
Date: Sun, 21 Nov 2010 22:58:24 -0800
Subject: [PATCH] fixed failing photoscontroller spec.

---
 app/controllers/photos_controller.rb | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb
index d5aebe1990..39c3c8c832 100644
--- a/app/controllers/photos_controller.rb
+++ b/app/controllers/photos_controller.rb
@@ -77,9 +77,16 @@ class PhotosController < ApplicationController
     if photo
       photo.destroy
       flash[:notice] = I18n.t 'photos.destroy.notice'
+
+      if photo.status_message_id
+        respond_with :location => photo.status_message
+      else
+        respond_with :location => photos_path
+      end
+    else
+      respond_with :location => photos_path
     end
-    
-    respond_with :location => photo.status_message
+   
   end
 
   def show
@@ -108,7 +115,6 @@ class PhotosController < ApplicationController
       if current_user.update_post( photo, params[:photo] )
         flash.now[:notice] = I18n.t 'photos.update.notice'
         respond_to do |format|
-          format.html
           format.js{ render :json => photo, :status => 200 }
         end
       else
-- 
GitLab