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.

26 lines
743 B

  1. require 'rails_helper'
  2. RSpec.describe XrdController, type: :controller do
  3. render_views
  4. describe 'GET #host_meta' do
  5. it 'returns http success' do
  6. get :host_meta
  7. expect(response).to have_http_status(:success)
  8. end
  9. end
  10. describe 'GET #webfinger' do
  11. let(:alice) { Fabricate(:account, username: 'alice') }
  12. it 'returns http success when account can be found' do
  13. get :webfinger, params: { resource: "acct:#{alice.username}@anything.com" }
  14. expect(response).to have_http_status(:success)
  15. end
  16. it 'returns http not found when account cannot be found' do
  17. get :webfinger, params: { resource: 'acct:not@existing.com' }
  18. expect(response).to have_http_status(:not_found)
  19. end
  20. end
  21. end