diff --git a/lib/common.rb b/lib/common.rb index 8b8e0acf4e5dc43deecd86c08993aecc544cc8cf..2974371d07311d323a0f3f6023576d3a7f67e94b 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 b17192f398e6c23990f4148439bbd923e48cdd85..ddf5c2086a61a51e3346abd4c1fc773b718bc540 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