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.
 
 
 
 

30 lines
761 B

  1. require 'rails_helper'
  2. RSpec.describe ActivityPub::Activity::Add 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. target: 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. subject.perform
  19. end
  20. it 'creates a pin' do
  21. expect(sender.pinned?(status)).to be true
  22. end
  23. end
  24. end