Method: GdsApi::TestHelpers::AccountApi#stub_account_api_get_sign_in_url

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

#stub_account_api_get_sign_in_url(redirect_path: nil, mfa: false, auth_uri: "http://auth/provider", state: "state") ⇒ Object

GET /api/oauth2/sign-in



22
23
24
25
26
27
28
29
# File 'lib/gds_api/test_helpers/account_api.rb', line 22

def (redirect_path: nil, mfa: false, auth_uri: "http://auth/provider", state: "state")
  querystring = Rack::Utils.build_nested_query({ redirect_path:, mfa: }.compact)
  stub_request(:get, "#{ACCOUNT_API_ENDPOINT}/api/oauth2/sign-in?#{querystring}")
    .to_return(
      status: 200,
      body: { auth_uri:, state: }.to_json,
    )
end