-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic coverage for some worker jobs (#23943)
- Loading branch information
1 parent
f9c2213
commit 39e7525
Showing
22 changed files
with
303 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe Admin::AccountDeletionWorker do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
let(:account) { Fabricate(:account) } | ||
let(:service) { instance_double(DeleteAccountService, call: true) } | ||
|
||
it 'calls delete account service' do | ||
allow(DeleteAccountService).to receive(:new).and_return(service) | ||
worker.perform(account.id) | ||
|
||
expect(service).to have_received(:call).with(account, { reserve_email: true, reserve_username: true }) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe CacheBusterWorker do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
let(:path) { 'https://example.com' } | ||
let(:service) { instance_double(CacheBuster, bust: true) } | ||
|
||
it 'calls the cache buster' do | ||
allow(CacheBuster).to receive(:new).and_return(service) | ||
worker.perform(path) | ||
|
||
expect(service).to have_received(:bust).with(path) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe PollExpirationNotifyWorker do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error for missing record' do | ||
expect { worker.perform(nil) }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe PostProcessMediaWorker do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error for missing record' do | ||
expect { worker.perform(nil) }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe PushConversationWorker do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error for missing record' do | ||
expect { worker.perform(nil) }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe PushEncryptedMessageWorker do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error for missing record' do | ||
expect { worker.perform(nil) }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe PushUpdateWorker do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error for missing record' do | ||
account_id = nil | ||
status_id = nil | ||
|
||
expect { worker.perform(account_id, status_id) }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe RedownloadAvatarWorker do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error for missing record' do | ||
expect { worker.perform(nil) }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe RedownloadHeaderWorker do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error for missing record' do | ||
expect { worker.perform(nil) }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe RemoveFeaturedTagWorker do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error for missing record' do | ||
account_id = nil | ||
featured_tag_id = nil | ||
expect { worker.perform(account_id, featured_tag_id) }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe ResolveAccountWorker do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error for missing record' do | ||
expect { worker.perform(nil) }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe Scheduler::IndexingScheduler do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error' do | ||
expect { worker.perform }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe Scheduler::InstanceRefreshScheduler do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error' do | ||
expect { worker.perform }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe Scheduler::IpCleanupScheduler do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error' do | ||
expect { worker.perform }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe Scheduler::PgheroScheduler do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error' do | ||
expect { worker.perform }.to_not raise_error | ||
end | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
spec/workers/scheduler/scheduled_statuses_scheduler_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe Scheduler::ScheduledStatusesScheduler do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error' do | ||
expect { worker.perform }.to_not raise_error | ||
end | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
spec/workers/scheduler/suspended_user_cleanup_scheduler_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe Scheduler::SuspendedUserCleanupScheduler do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error' do | ||
expect { worker.perform }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe Scheduler::Trends::RefreshScheduler do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error' do | ||
expect { worker.perform }.to_not raise_error | ||
end | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
spec/workers/scheduler/trends/review_notifications_scheduler_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe Scheduler::Trends::ReviewNotificationsScheduler do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error' do | ||
expect { worker.perform }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe Scheduler::VacuumScheduler do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error' do | ||
expect { worker.perform }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe UnpublishAnnouncementWorker do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error for missing record' do | ||
expect { worker.perform(nil) }.to_not raise_error | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
describe Webhooks::DeliveryWorker do | ||
let(:worker) { described_class.new } | ||
|
||
describe 'perform' do | ||
it 'runs without error' do | ||
expect { worker.perform(nil, nil) }.to_not raise_error | ||
end | ||
end | ||
end |