link_headers_spec.rb 652 B

1234567891011121314151617
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe 'Link headers' do
  4. describe 'on the account show page' do
  5. let(:account) { Fabricate(:account, username: 'test') }
  6. it 'contains webfinger and activitypub urls in link header' do
  7. get short_account_path(username: account)
  8. expect(response)
  9. .to have_http_link_header('https://cb6e6126.ngrok.io/.well-known/webfinger?resource=acct%3Atest%40cb6e6126.ngrok.io').for(rel: 'lrdd', type: 'application/jrd+json')
  10. .and have_http_link_header('https://cb6e6126.ngrok.io/users/test').for(rel: 'alternate', type: 'application/activity+json')
  11. end
  12. end
  13. end