Add basic request spec for /.well-known/oauth-authorization-server endpoint

This commit is contained in:
Emelia Smith 2024-02-13 21:02:47 +01:00
parent abf97aac0f
commit 43efeb316e
No known key found for this signature in database
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
# frozen_string_literal: true
require 'rails_helper'
describe 'The /.well-known/oauth-authorization-server request' do
it 'returns http success with valid JSON response' do
get '/.well-known/oauth-authorization-server'
expect(response)
.to have_http_status(200)
.and have_attributes(
media_type: 'application/json'
)
expect(body_as_json).to match(
a_hash_including(
# FIXME: Include tests for the important URLs (for some reason routing
# was generating mismatching URLs between the serializer and the tests)
scopes_supported: Doorkeeper.configuration.scopes.map(&:to_s)
)
)
end
end