diaspora/spec/controllers/api/openid_connect/discovery_controller_spec.rb
Jonne Haß 0aba20f85c OpenID Connect: ensure consistent issuer URL
root_url does not know the right protocol in all contexts,
some clients are strict when validating this.
2020-10-24 22:30:43 +02:00

19 lines
558 B
Ruby

# frozen_string_literal: true
describe Api::OpenidConnect::DiscoveryController, type: :controller do
describe "#configuration" do
before do
get :configuration
end
it "should have the issuer as the root url" do
json_body = JSON.parse(response.body)
expect(json_body["issuer"]).to eq(AppConfig.environment.url)
end
it "should have the appropriate user info endpoint" do
json_body = JSON.parse(response.body)
expect(json_body["userinfo_endpoint"]).to eq(api_openid_connect_user_info_url)
end
end
end