Took out putses
This commit is contained in:
parent
10e01c0a94
commit
de3a08d031
4 changed files with 10 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
#
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue