Add an /identity.json endpoint to obtain the identity accounts and users

This commit is contained in:
Jay Ohms
2025-12-04 10:52:21 -05:00
committed by Stanko K.R.
parent 9fceef16e9
commit 26fc9ecad4
5 changed files with 27 additions and 0 deletions
+8
View File
@@ -70,6 +70,14 @@ class ApiTest < ActionDispatch::IntegrationTest
assert_equal users(:david).name, @response.parsed_body["name"]
end
test "get identity" do
identity = identities(:david)
get identity_path(format: :json), env: @davids_bearer_token
assert_response :success # Fix 302 redirect
assert_equal identity.accounts.count, @response.parsed_body["accounts"].count
end
private
def bearer_token_env(token)
{ "HTTP_AUTHORIZATION" => "Bearer #{token}" }