logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

block_spec.rb (687B)


  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