闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
687 B

  1. require 'rails_helper'
  2. RSpec.describe ActivityPub::Activity::Block do
  3. let(:sender) { Fabricate(:account) }
  4. let(:recipient) { Fabricate(:account) }
  5. let(:json) do
  6. {
  7. '@context': 'https://www.w3.org/ns/activitystreams',
  8. id: 'foo',
  9. type: 'Block',
  10. actor: ActivityPub::TagManager.instance.uri_for(sender),
  11. object: ActivityPub::TagManager.instance.uri_for(recipient),
  12. }.with_indifferent_access
  13. end
  14. describe '#perform' do
  15. subject { described_class.new(json, sender) }
  16. before do
  17. subject.perform
  18. end
  19. it 'creates a block from sender to recipient' do
  20. expect(sender.blocking?(recipient)).to be true
  21. end
  22. end
  23. end