This repository has been archived on 2019-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon/spec/routing/well_known_routes_spec.rb
Matt Jankowski 21a767dcfa Improve handling of HTTP_ACCEPT for webfinger (#2008)
This change includes:

- Improve the spec coverage for incoming request to the webfinger action
- For requests without an accept header (ie, what a browser might look like),
  return a JSON response.
- For requests with an explicit format of xml or json, return that format.
- For requests using an accept header, return that format.

Also adds failing spec showing webfinger does not return xml, which covers the
issue described in: https://github.com/tootsuite/mastodon/issues/1983
2017-04-17 19:58:03 +02:00

16 lines
409 B
Ruby

require 'rails_helper'
describe 'the host-meta route' do
it 'routes to correct place with xml format' do
expect(get('/.well-known/host-meta')).
to route_to('well_known/host_meta#show', format: 'xml')
end
end
describe 'the webfinger route' do
it 'routes to correct place with json format' do
expect(get('/.well-known/webfinger')).
to route_to('well_known/webfinger#show')
end
end