The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

31 lines
822 B

  1. require 'rails_helper'
  2. RSpec.describe ActivityPub::Activity::Remove do
  3. let(:sender) { Fabricate(:account, featured_collection_url: 'https://example.com/featured') }
  4. let(:status) { Fabricate(:status, account: sender) }
  5. let(:json) do
  6. {
  7. '@context': 'https://www.w3.org/ns/activitystreams',
  8. id: 'foo',
  9. type: 'Add',
  10. actor: ActivityPub::TagManager.instance.uri_for(sender),
  11. object: ActivityPub::TagManager.instance.uri_for(status),
  12. origin: sender.featured_collection_url,
  13. }.with_indifferent_access
  14. end
  15. describe '#perform' do
  16. subject { described_class.new(json, sender) }
  17. before do
  18. StatusPin.create!(account: sender, status: status)
  19. subject.perform
  20. end
  21. it 'removes a pin' do
  22. expect(sender.pinned?(status)).to be false
  23. end
  24. end
  25. end