test/integrations/non_web_test.rb in errdo-0.11.2 vs test/integrations/non_web_test.rb in errdo-0.11.3
- old
+ new
@@ -1,15 +1,18 @@
require 'test_helper'
-class FailJob < ActiveJob::Base
- queue_as :default
+if defined?(ActiveJob::Base)
+ class FailJob < ActiveJob::Base
- def perform(*_args)
- raise "AsynchronousFailure"
- end
+ queue_as :default
+ def perform(*_args)
+ raise "AsynchronousFailure"
+ end
+
+ end
end
class NonWebTest < ActionDispatch::IntegrationTest
# rubocop:disable Style/RescueModifier
@@ -50,14 +53,16 @@
end
end
# rubocop:enable Style/RescueModifier
# rubocop:enable Lint/HandleExceptions
- context "active jobs" do
- should "log to errdo when job fails asynchronously" do
- assert_difference 'Errdo::ErrorOccurrence.count', 1 do
- # rubocop:disable Style/RescueModifier
- FailJob.perform_now rescue ""
+ if defined?(ActiveJob::Base)
+ context "active jobs" do
+ should "log to errdo when job fails asynchronously" do
+ assert_difference 'Errdo::ErrorOccurrence.count', 1 do
+ # rubocop:disable Style/RescueModifier
+ FailJob.perform_now rescue ""
+ end
end
end
end
end