shares_spec.rb 713 B

12345678910111213141516171819202122232425
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe 'ActivityPub Shares' do
  4. let(:account) { Fabricate(:account) }
  5. let(:status) { Fabricate :status, account: account }
  6. before { Fabricate :status, reblog: status }
  7. describe 'GET /accounts/:account_username/statuses/:status_id/shares' do
  8. it 'returns http success and activity json types and correct items count' do
  9. get account_status_shares_path(account, status)
  10. expect(response)
  11. .to have_http_status(200)
  12. expect(response.media_type)
  13. .to eq 'application/activity+json'
  14. expect(response.parsed_body)
  15. .to include(type: 'Collection')
  16. .and include(totalItems: 1)
  17. end
  18. end
  19. end