Merge remote-tracking branch 'parent/main' into upstream-20241026

This commit is contained in:
KMY 2024-10-26 10:41:00 +09:00
commit 0c99b8fbb0
79 changed files with 2403 additions and 2056 deletions

View file

@ -0,0 +1,33 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe ActivityPub::FollowersSynchronizationWorker do
let(:worker) { described_class.new }
let(:service) { instance_double(ActivityPub::SynchronizeFollowersService, call: true) }
describe '#perform' do
before { stub_service }
let(:account) { Fabricate(:account, domain: 'host.example') }
let(:url) { 'https://sync.url' }
it 'sends the status to the service' do
worker.perform(account.id, url)
expect(service).to have_received(:call).with(account, url)
end
it 'returns nil for non-existent record' do
result = worker.perform(123_123_123, url)
expect(result).to be(true)
end
end
def stub_service
allow(ActivityPub::SynchronizeFollowersService)
.to receive(:new)
.and_return(service)
end
end