Method: GdsApi::TestHelpers::AccountApi#stub_update_user_by_subject_identifier

Defined in:
lib/gds_api/test_helpers/account_api.rb

#stub_update_user_by_subject_identifier(subject_identifier:, email: nil, email_verified: nil, old_email: nil, old_email_verified: nil) ⇒ Object

PATCH /api/oidc-users/:subject_identifier



162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/gds_api/test_helpers/account_api.rb', line 162

def stub_update_user_by_subject_identifier(subject_identifier:, email: nil, email_verified: nil, old_email: nil, old_email_verified: nil)
  (
    :patch,
    "/api/oidc-users/#{subject_identifier}",
    with: { body: hash_including({ email:, email_verified: }.compact) },
    response_body: {
      sub: subject_identifier,
      email: email || old_email,
      email_verified: email_verified || old_email_verified,
    },
  )
end