闭社主体 forked from https://github.com/tootsuite/mastodon
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.

24 lines
674 B

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