From 41c358d53cfd1da3273f2e5117d234c07f34c97d Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 22 Jul 2010 11:43:59 -0700 Subject: [PATCH] Storing in phototest --- spec/models/photo_spec.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 208fd1d96..9ca10e39b 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -16,8 +16,7 @@ describe Photo do end it 'should save a @photo to GridFS' do - file = File.open(@fixture_name) - @photo.image = file + @photo.image.store! File.open(@fixture_name) @photo.save.should == true binary = @photo.image.read fixture_binary = File.open(@fixture_name).read @@ -27,8 +26,7 @@ describe Photo do it 'must have an album' do photo = Photo.new(:person => @user) - file = File.open(@fixture_name) - photo.image = file + photo.image = File.open(@fixture_name) photo.save photo.valid?.should be false photo.album = Album.create(:name => "foo", :person => @user)