Storing in phototest
This commit is contained in:
parent
b90cb95c64
commit
41c358d53c
1 changed files with 2 additions and 4 deletions
|
|
@ -16,8 +16,7 @@ describe Photo do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should save a @photo to GridFS' do
|
it 'should save a @photo to GridFS' do
|
||||||
file = File.open(@fixture_name)
|
@photo.image.store! File.open(@fixture_name)
|
||||||
@photo.image = file
|
|
||||||
@photo.save.should == true
|
@photo.save.should == true
|
||||||
binary = @photo.image.read
|
binary = @photo.image.read
|
||||||
fixture_binary = File.open(@fixture_name).read
|
fixture_binary = File.open(@fixture_name).read
|
||||||
|
|
@ -27,8 +26,7 @@ describe Photo do
|
||||||
it 'must have an album' do
|
it 'must have an album' do
|
||||||
|
|
||||||
photo = Photo.new(:person => @user)
|
photo = Photo.new(:person => @user)
|
||||||
file = File.open(@fixture_name)
|
photo.image = File.open(@fixture_name)
|
||||||
photo.image = file
|
|
||||||
photo.save
|
photo.save
|
||||||
photo.valid?.should be false
|
photo.valid?.should be false
|
||||||
photo.album = Album.create(:name => "foo", :person => @user)
|
photo.album = Album.create(:name => "foo", :person => @user)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue