From de3a08d031bd88d3d481bcc02a0031801a80bc0a Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 20 Jul 2010 10:23:19 -0700 Subject: [PATCH] Took out putses --- app/models/photo.rb | 3 --- config/sprinkle/provision.rb | 2 ++ lib/encryptable.rb | 2 -- spec/models/photo_spec.rb | 10 ++++++++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/models/photo.rb b/app/models/photo.rb index 42e704273..70e65cb64 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -1,8 +1,5 @@ class Photo < Post require 'carrierwave/orm/mongomapper' include MongoMapper::Document - before_validation {puts "I'M GONNA VALIDATE"} - before_save {puts "I'M GONNA SAVE"} - before_create {puts "I'M GONNA CREATE"} mount_uploader :image, ImageUploader end diff --git a/config/sprinkle/provision.rb b/config/sprinkle/provision.rb index 215ca83f1..b922a4137 100644 --- a/config/sprinkle/provision.rb +++ b/config/sprinkle/provision.rb @@ -44,6 +44,7 @@ policy :diaspora, :roles => [:tom, :backer] do requires :scm end =begin + policy :ci, :roles => :ci do requires :tools requires :rubygems @@ -54,6 +55,7 @@ policy :ci, :roles => :ci do requires :scm #add sqlite end + =end # Deployment # diff --git a/lib/encryptable.rb b/lib/encryptable.rb index 226ae5e1f..cc5682f95 100644 --- a/lib/encryptable.rb +++ b/lib/encryptable.rb @@ -21,14 +21,12 @@ protected def sign_if_mine - puts "In sign_if_mine" if self.person == User.owner self.creator_signature = sign end end def sign - puts "signing" sign_with_key(User.owner.key) end diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 148251e8d..5266b837d 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -4,6 +4,8 @@ describe Photo do before do @user = Factory.create(:user) @fixture_name = File.dirname(__FILE__) + '/../fixtures/bp.jpeg' + @fail_fixture_name = File.dirname(__FILE__) + '/../fixtures/msg.xml' + end it 'should save a photo to GridFS' do photo = Photo.new(:person => @user) @@ -15,8 +17,12 @@ describe Photo do binary.should == fixture_binary end - it 'should create thumbnails' do - pending('need to figure this out... tearing issue') + it 'should not accept files of non-image types' do + photo = Photo.new(:person => @user) + file = File.open(@fail_fixture_name) + photo.image = file + photo.save.should == false + end describe 'with encryption' do