about summary refs log tree commit diff
path: root/spec/workers/activitypub/thread_resolve_worker_spec.rb
blob: b954cb62caaec8f5db7c1ace648bc18f26ffcf20 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'rails_helper'

describe ActivityPub::ThreadResolveWorker do
  subject { described_class.new }

  let(:status) { Fabricate(:status) }
  let(:parent) { Fabricate(:status) }

  describe '#perform' do
    it 'gets parent from ActivityPub::FetchRemoteStatusService and glues them together' do
      allow(ActivityPub::FetchRemoteStatusService).to receive(:new).and_return(double(:service, call: parent))
      subject.perform(status.id, 'http://example.com/123')
      expect(status.reload.in_reply_to_id).to eq parent.id
    end
  end
end