Took out putses

This commit is contained in:
Raphael 2010-07-20 10:23:19 -07:00
parent 10e01c0a94
commit de3a08d031
4 changed files with 10 additions and 7 deletions

View file

@ -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

View file

@ -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
#

View file

@ -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

View file

@ -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