From 773dbd91aa2e96f09c081b65b0bf0abf9a352635 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 22 Jul 2010 10:21:10 -0700 Subject: [PATCH] RS IZ one more test passing going to bisect --- app/models/photo.rb | 1 + spec/models/photo_spec.rb | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/models/photo.rb b/app/models/photo.rb index d2a92c922..bfb7c912f 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -16,6 +16,7 @@ class Photo < Post def remote_photo + puts image.url User.owner.url.chop + image.url end diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index ddf5c2086..439e40ce6 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -15,6 +15,19 @@ describe Photo do fixture_binary = File.open(@fixture_name).read binary.should == fixture_binary end + + it 'must have an album' do + + photo = Photo.new(:person => @user) + file = File.open(@fixture_name) + photo.image = file + photo.save + photo.valid?.should be false + photo.album = Album.create(:name => "foo", :person => @user) + photo.save + Photo.first.album.name.should == 'foo' + end + describe 'non-image files' do it 'should not store' do file = File.open(@fail_fixture_name) @@ -33,13 +46,7 @@ describe Photo do end - it 'must have an album' do - photo = Photo.new(:person => @user) - photo.valid?.should be false - photo.album = Album.new(:name => "foo", :person => @user) - photo.save - Photo.first.album.name.should == 'foo' - end + end describe 'with encryption' do