wrote a test for the callback, need to make it pass...
This commit is contained in:
parent
58282b91cb
commit
82a79c95fe
2 changed files with 10 additions and 7 deletions
|
|
@ -7,14 +7,7 @@ module Job
|
||||||
class ProcessPhoto < Base
|
class ProcessPhoto < Base
|
||||||
@queue = :photos
|
@queue = :photos
|
||||||
def self.perform_delegate(photo_id)
|
def self.perform_delegate(photo_id)
|
||||||
begin
|
|
||||||
Photo.find(photo_id).image.post_process
|
Photo.find(photo_id).image.post_process
|
||||||
rescue Exception => e
|
|
||||||
puts e.inspect
|
|
||||||
|
|
||||||
ensure
|
|
||||||
puts "photo has been processed"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,15 @@ describe Photo do
|
||||||
end
|
end
|
||||||
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
|
it 'is mutable' do
|
||||||
@photo.mutable?.should == true
|
@photo.mutable?.should == true
|
||||||
end
|
end
|
||||||
|
|
@ -124,6 +133,7 @@ describe Photo do
|
||||||
@xml.include?(@user.diaspora_handle).should be true
|
@xml.include?(@user.diaspora_handle).should be true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'remote photos' do
|
describe 'remote photos' do
|
||||||
it 'should set the remote_photo on marshalling' do
|
it 'should set the remote_photo on marshalling' do
|
||||||
@photo.image.store! File.open(@fixture_name)
|
@photo.image.store! File.open(@fixture_name)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue