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 class Photo < Post
require 'carrierwave/orm/mongomapper' require 'carrierwave/orm/mongomapper'
include MongoMapper::Document 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 mount_uploader :image, ImageUploader
end end

View file

@ -44,6 +44,7 @@ policy :diaspora, :roles => [:tom, :backer] do
requires :scm requires :scm
end end
=begin =begin
policy :ci, :roles => :ci do policy :ci, :roles => :ci do
requires :tools requires :tools
requires :rubygems requires :rubygems
@ -54,6 +55,7 @@ policy :ci, :roles => :ci do
requires :scm requires :scm
#add sqlite #add sqlite
end end
=end =end
# Deployment # Deployment
# #

View file

@ -21,14 +21,12 @@
protected protected
def sign_if_mine def sign_if_mine
puts "In sign_if_mine"
if self.person == User.owner if self.person == User.owner
self.creator_signature = sign self.creator_signature = sign
end end
end end
def sign def sign
puts "signing"
sign_with_key(User.owner.key) sign_with_key(User.owner.key)
end end

View file

@ -4,6 +4,8 @@ describe Photo do
before do before do
@user = Factory.create(:user) @user = Factory.create(:user)
@fixture_name = File.dirname(__FILE__) + '/../fixtures/bp.jpeg' @fixture_name = File.dirname(__FILE__) + '/../fixtures/bp.jpeg'
@fail_fixture_name = File.dirname(__FILE__) + '/../fixtures/msg.xml'
end end
it 'should save a photo to GridFS' do it 'should save a photo to GridFS' do
photo = Photo.new(:person => @user) photo = Photo.new(:person => @user)
@ -15,8 +17,12 @@ describe Photo do
binary.should == fixture_binary binary.should == fixture_binary
end end
it 'should create thumbnails' do it 'should not accept files of non-image types' do
pending('need to figure this out... tearing issue') photo = Photo.new(:person => @user)
file = File.open(@fail_fixture_name)
photo.image = file
photo.save.should == false
end end
describe 'with encryption' do describe 'with encryption' do