wrote a test for the callback, need to make it pass...

This commit is contained in:
maxwell 2011-03-17 00:00:09 -07:00
parent 58282b91cb
commit 82a79c95fe
2 changed files with 10 additions and 7 deletions

View file

@ -7,14 +7,7 @@ module Job
class ProcessPhoto < Base
@queue = :photos
def self.perform_delegate(photo_id)
begin
Photo.find(photo_id).image.post_process
rescue Exception => e
puts e.inspect
ensure
puts "photo has been processed"
end
end
end
end

View file

@ -35,6 +35,15 @@ describe Photo do
end
end
describe 'after create' do
it 'calls #queue_processing_job' do
p = Factory.build(:photo, :image => File.open(@fixture_name))
p.should_receive(:queue_processing_job)
p.save!
end
end
it 'is mutable' do
@photo.mutable?.should == true
end
@ -124,6 +133,7 @@ describe Photo do
@xml.include?(@user.diaspora_handle).should be true
end
end
describe 'remote photos' do
it 'should set the remote_photo on marshalling' do
@photo.image.store! File.open(@fixture_name)