diff --git a/lib/active_scheduler/resque_wrapper.rb b/lib/active_scheduler/resque_wrapper.rb index e88dd6b..7c4fd33 100644 --- a/lib/active_scheduler/resque_wrapper.rb +++ b/lib/active_scheduler/resque_wrapper.rb @@ -29,10 +29,7 @@ def self.wrap(schedule) class_name = opts[:class] || job next if class_name =~ /#{self.to_s}/ - klass = class_name.constantize - next unless klass <= ActiveJob::Base - - queue = opts[:queue] || klass.queue_name + queue = opts[:queue] args = opts[:args] named_args = opts[:named_args] || false diff --git a/spec/active_scheduler/resque_wrapper_spec.rb b/spec/active_scheduler/resque_wrapper_spec.rb index d56c4de..eec0271 100644 --- a/spec/active_scheduler/resque_wrapper_spec.rb +++ b/spec/active_scheduler/resque_wrapper_spec.rb @@ -24,20 +24,6 @@ ) end - context "job is not an active job descendant" do - it "doesn't wrap" do - stub_const("SimpleJob", Class.new) - expect(wrapped['simple_job']).to eq( - "class" => "SimpleJob", - "queue" => "simple", - "description" => "It's a simple job.", - "every" => "30s", - "rails_env" => "test", - "args" => ['foo-arg-1', 'foo-arg-2'], - ) - end - end - context 'with a custom wrapper class' do class CustomWrapper < ActiveScheduler::ResqueWrapper end @@ -122,20 +108,6 @@ class CustomWrapper < ActiveScheduler::ResqueWrapper end end - context "when the queue is blank" do - let(:schedule) { YAML.load_file 'spec/fixtures/no_queue.yaml' } - - it "uses the job's queue" do - simple_job = Class.new(ActiveJob::Base) do - queue_as :myscheduledjobqueue - end - - stub_const("SimpleJob", simple_job) - - expect(wrapped['no_queue_job']['queue']).to eq 'myscheduledjobqueue' - end - end - context "when the schedule name is the class name" do let(:schedule) { YAML.load_file 'spec/fixtures/schedule_name_is_class_name.yaml' }