2013-02-06 03:16:51 +08:00
|
|
|
require 'spec_helper'
|
2013-10-01 15:04:02 +08:00
|
|
|
require_dependency 'jobs/base'
|
2013-02-06 03:16:51 +08:00
|
|
|
|
|
|
|
describe Jobs::Base do
|
|
|
|
|
|
|
|
it 'delegates the process call to execute' do
|
|
|
|
Jobs::Base.any_instance.expects(:execute).with('hello' => 'world')
|
|
|
|
Jobs::Base.new.perform('hello' => 'world', 'sync_exec' => true)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'converts to an indifferent access hash' do
|
|
|
|
Jobs::Base.any_instance.expects(:execute).with(instance_of(HashWithIndifferentAccess))
|
|
|
|
Jobs::Base.new.perform('hello' => 'world', 'sync_exec' => true)
|
2013-02-26 00:42:20 +08:00
|
|
|
end
|
2013-02-06 03:16:51 +08:00
|
|
|
|
|
|
|
end
|
|
|
|
|