From b6ab4db7ccdf11ab9377d5a23cfd59a3e9616dd9 Mon Sep 17 00:00:00 2001
From: Raphael <raphael@joindiaspora.com>
Date: Thu, 22 Jul 2010 10:12:25 -0700
Subject: [PATCH] Trying to get photos working again

---
 lib/common.rb             | 2 +-
 spec/models/photo_spec.rb | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/common.rb b/lib/common.rb
index 8b8e0acf4e..2974371d07 100644
--- a/lib/common.rb
+++ b/lib/common.rb
@@ -21,7 +21,7 @@ module Diaspora
           object.person =  parse_owner_from_xml post.to_s if object.respond_to? :person  
           objects << object 
         rescue
-          puts "Not a real type: #{object.to_s}"
+          Rails.logger.info "Not a real type: #{object.to_s}"
         end
       end
       objects
diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb
index b17192f398..ddf5c2086a 100644
--- a/spec/models/photo_spec.rb
+++ b/spec/models/photo_spec.rb
@@ -5,7 +5,7 @@ describe Photo do
     @user = Factory.create(:user)
     @fixture_name = File.dirname(__FILE__) + '/../fixtures/bp.jpeg'
     @fail_fixture_name = File.dirname(__FILE__) + '/../fixtures/msg.xml'
-    @photo = Photo.new(:person => @user, :album => Album.create(:name => "foo"))
+    @photo = Photo.new(:person => @user, :album => Album.create(:name => "foo", :person => @user))
   end
   it 'should save a @photo to GridFS' do
     file = File.open(@fixture_name)
@@ -36,7 +36,7 @@ describe Photo do
     it  'must have an album' do
       photo = Photo.new(:person => @user)
       photo.valid?.should be false
-      photo.album = Album.new(:name => "foo")
+      photo.album = Album.new(:name => "foo", :person => @user)
       photo.save
       Photo.first.album.name.should == 'foo'
     end
@@ -64,7 +64,7 @@ describe Photo do
     it 'should write the url on serialization' do 
       @photo.image = File.open(@fixture_name)
       xml = @photo.to_xml.to_s
-      xml.include?(@photo.image.path).should be true
+      xml.include?(@photo.image.url).should be true
       remote_photo = Photo.from_xml xml
       @photo.destroy
       remote_photo.image.read.nil?.should be false
-- 
GitLab