mirror of
https://github.com/mastodon/mastodon.git
synced 2026-03-21 18:05:23 -05:00
26 lines
808 B
Ruby
26 lines
808 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe RevokeCollectionItemService do
|
|
subject { described_class.new }
|
|
|
|
let(:collection_item) { Fabricate(:collection_item) }
|
|
|
|
it 'revokes the collection item and sends a Delete activity' do
|
|
expect { subject.call(collection_item) }
|
|
.to change { collection_item.reload.state }.from('accepted').to('revoked')
|
|
end
|
|
|
|
context 'when the collection is remote', feature: :collections_federation do
|
|
let(:collection) { Fabricate(:remote_collection) }
|
|
let(:collection_item) { Fabricate(:collection_item, collection:, uri: 'https://example.com') }
|
|
|
|
it 'federates a `Delete` activity' do
|
|
subject.call(collection_item)
|
|
|
|
expect(ActivityPub::AccountRawDistributionWorker).to have_enqueued_sidekiq_job
|
|
end
|
|
end
|
|
end
|