This commit is contained in:
KMY 2023-09-27 11:27:52 +09:00
parent 097e7ac5d1
commit f9ccc88657
2 changed files with 18 additions and 1 deletions

View file

@ -3,7 +3,7 @@
class ProcessReferencesWorker
include Sidekiq::Worker
def perform(status_id, ids, urls, no_fetch_urls)
def perform(status_id, ids, urls, no_fetch_urls = nil)
ProcessReferencesService.new.call(Status.find(status_id), ids || [], urls: urls || [], no_fetch_urls: no_fetch_urls)
rescue ActiveRecord::RecordNotFound
true

View file

@ -0,0 +1,17 @@
# frozen_string_literal: true
require 'rails_helper'
describe ProcessReferencesWorker do
let(:worker) { described_class.new }
describe 'perform' do
it 'runs without error for simple call' do
expect { worker.perform(1000, [], []) }.to_not raise_error
end
it 'runs without error with no_fetch_urls' do
expect { worker.perform(1000, [], [], no_fetch_urls: []) }.to_not raise_error
end
end
end