From f1ef6d0391b64b4cdd096aaf1f51bcdcd1689462 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Fri, 17 Feb 2023 13:27:43 +0100 Subject: [PATCH] (test) list auth providers --- test/integration/auth_providers_test.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/integration/auth_providers_test.rb b/test/integration/auth_providers_test.rb index b21860788..372c31dc8 100644 --- a/test/integration/auth_providers_test.rb +++ b/test/integration/auth_providers_test.rb @@ -86,6 +86,18 @@ class AuthProvidersTest < ActionDispatch::IntegrationTest assert_equal 'openidconnect-sleede', response.body end + test 'list all authentication providers' do + get '/api/auth_providers' + + # Check response format & status + assert_equal 200, response.status, response.body + assert_equal Mime[:json], response.content_type + + # Check the answer + res = json_response(response.body) + assert_equal AuthProvider.count, res.length + end + test 'show an authentication provider' do provider = AuthProvider.first get "/api/auth_providers/#{provider.id}" @@ -94,7 +106,7 @@ class AuthProvidersTest < ActionDispatch::IntegrationTest assert_equal 200, response.status, response.body assert_equal Mime[:json], response.content_type - # Check the provider was updated + # Check the provider res = json_response(response.body) assert_equal provider.id, res[:id] assert_equal provider.providable_type, res[:providable_type]