Skip to content

Commit

Permalink
[ARP-86023] ARP IPF: Expand ARP user test factory.
Browse files Browse the repository at this point in the history
  • Loading branch information
nihil2501 committed Sep 6, 2024
1 parent 9a27c4b commit 88d388d
Showing 1 changed file with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

FactoryBot.define do
factory :representative_user, class: 'AccreditedRepresentativePortal::RepresentativeUser' do
transient do
sign_in_service_name { SignIn::Constants::Auth::IDME }
end

authn_context { LOA::IDME_LOA3_VETS }
email { Faker::Internet.email }
fingerprint { Faker::Internet.ip_v4_address }
Expand All @@ -12,12 +16,32 @@
last_signed_in { Time.zone.now }
loa { { current: LOA::THREE, highest: LOA::THREE } }
logingov_uuid { SecureRandom.uuid }

sign_in {
{
service_name: SignIn::Constants::Auth::IDME, client_id: SecureRandom.uuid,
auth_broker: SignIn::Constants::Auth::BROKER_CODE
auth_broker: SignIn::Constants::Auth::BROKER_CODE,
client_id: SecureRandom.uuid,
service_name: sign_in_service_name
}
}

user_account_uuid { create(:user_account).id }
uuid { SecureRandom.uuid }

trait :with_in_progress_form do
transient do
in_progress_form_id { Faker::Form.id }
in_progress_form_return_url { Faker::Internet.url }
end

after(:create) do |user, evaluator|
create(:in_progress_form, {
form_id: evaluator.in_progress_form_id,
return_url: evaluator.in_progress_form_return_url,
user_account: user.user_account,
user_uuid: user.uuid
})
end
end
end
end

0 comments on commit 88d388d

Please sign in to comment.