Method: GdsApi::TestHelpers::AccountApi#stub_account_api_validates_auth_response

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

#stub_account_api_validates_auth_response(code: nil, state: nil, govuk_account_session: "govuk-account-session", redirect_path: "/", ga_client_id: "ga-client-id", cookie_consent: false, feedback_consent: false) ⇒ Object

POST /api/oauth2/callback



34
35
36
37
38
39
40
41
# File 'lib/gds_api/test_helpers/account_api.rb', line 34

def (code: nil, state: nil, govuk_account_session: "govuk-account-session", redirect_path: "/", ga_client_id: "ga-client-id", cookie_consent: false, feedback_consent: false)
  stub_request(:post, "#{ACCOUNT_API_ENDPOINT}/api/oauth2/callback")
    .with(body: hash_including({ code:, state: }.compact))
    .to_return(
      status: 200,
      body: { govuk_account_session:, redirect_path:, ga_client_id:, cookie_consent:, feedback_consent: }.to_json,
    )
end