mirror of
https://github.com/mastodon/mastodon
synced 2024-12-21 10:08:13 +09:00
30 lines
745 B
Ruby
30 lines
745 B
Ruby
|
require 'rails_helper'
|
||
|
|
||
|
RSpec.describe ActivityPub::Activity::Announce do
|
||
|
let(:sender) { Fabricate(:account) }
|
||
|
let(:recipient) { Fabricate(:account) }
|
||
|
let(:status) { Fabricate(:status, account: recipient) }
|
||
|
|
||
|
let(:json) do
|
||
|
{
|
||
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||
|
id: 'foo',
|
||
|
type: 'Announce',
|
||
|
actor: ActivityPub::TagManager.instance.uri_for(sender),
|
||
|
object: ActivityPub::TagManager.instance.uri_for(status),
|
||
|
}.with_indifferent_access
|
||
|
end
|
||
|
|
||
|
describe '#perform' do
|
||
|
subject { described_class.new(json, sender) }
|
||
|
|
||
|
before do
|
||
|
subject.perform
|
||
|
end
|
||
|
|
||
|
it 'creates a reblog by sender of status' do
|
||
|
expect(sender.reblogged?(status)).to be true
|
||
|
end
|
||
|
end
|
||
|
end
|