Skip to content

Commit

Permalink
Add trait dpd_homologation_checkbox in factories
Browse files Browse the repository at this point in the history
  • Loading branch information
Isalafont committed Jan 20, 2025
1 parent fac46be commit b93f853
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/lib/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def create_authorization_requests_for_clamart
authorization_request = create_submitted_authorization_request(:api_entreprise, attributes: { intitule: 'Place des entreprises', applicant: another_demandeur })
send_message_to_instructors(authorization_request, body: "Je ne suis pas sûr du cadre de cette demande, pouvez-vous m'aider ?")

create_validated_authorization_request(:api_impot_particulier_sandbox, attributes: { intitule: 'Demande de retraite progressive en ligne', applicant: demandeur, data: { 'dpd_homologation_checkbox' => '1' } })
create_validated_authorization_request(:api_impot_particulier_sandbox, attributes: { intitule: 'Demande de retraite progressive en ligne', applicant: demandeur })

create_fully_approved_api_impot_particulier_authorization_request
end
Expand Down Expand Up @@ -248,7 +248,7 @@ def create_authorization_request_model(kind, attributes: {})

# rubocop:disable Metrics/AbcSize
def create_fully_approved_api_impot_particulier_authorization_request
authorization_request = create_validated_authorization_request(:api_impot_particulier_sandbox, attributes: { intitule: 'PASS FAMILLE', applicant: demandeur, data: { 'dpd_homologation_checkbox' => '1' }, created_at: 3.days.ago })
authorization_request = create_validated_authorization_request(:api_impot_particulier_sandbox, attributes: { intitule: 'PASS FAMILLE', applicant: demandeur, created_at: 3.days.ago })

StartNextAuthorizationRequestStage.call(authorization_request: authorization_request, user: authorization_request.applicant).perform

Expand Down
30 changes: 30 additions & 0 deletions spec/factories/authorization_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@
end
end

trait :with_dpd_homologation_checkbox do
after(:build) do |authorization_request, evaluator|
authorization_request.data['dpd_homologation_checkbox'] = '1' if authorization_request.need_complete_validation? || evaluator.fill_all_attributes
end
end

trait :hubee_cert_dc do
type { 'AuthorizationRequest::HubEECertDC' }
end
Expand Down Expand Up @@ -453,6 +459,8 @@
trait :api_impot_particulier_stationnement_residentiel_sandbox do
api_impot_particulier
form_uid { 'api-impot-particulier-stationnement-residentiel-sandbox' }

with_dpd_homologation_checkbox
end

trait :api_impot_particulier_stationnement_residentiel_production do
Expand All @@ -468,6 +476,8 @@
trait :api_impot_particulier_place_creche_sandbox do
api_impot_particulier
form_uid { 'api-impot-particulier-place-creche-sandbox' }

with_dpd_homologation_checkbox
end

trait :api_impot_particulier_place_creche_production do
Expand All @@ -483,6 +493,8 @@
trait :api_impot_particulier_activites_periscolaires_sandbox do
api_impot_particulier
form_uid { 'api-impot-particulier-activites-periscolaires-sandbox' }

with_dpd_homologation_checkbox
end

trait :api_impot_particulier_activites_periscolaires_production do
Expand All @@ -498,6 +510,8 @@
trait :api_impot_particulier_cantine_scolaire_sandbox do
api_impot_particulier
form_uid { 'api-impot-particulier-cantine-scolaire-sandbox' }

with_dpd_homologation_checkbox
end

trait :api_impot_particulier_cantine_scolaire_production do
Expand All @@ -513,6 +527,8 @@
trait :api_impot_particulier_aides_sociales_facultatives_sandbox do
api_impot_particulier
form_uid { 'api-impot-particulier-aides-sociales-facultatives-sandbox' }

with_dpd_homologation_checkbox
end

trait :api_impot_particulier_aides_sociales_facultatives_production do
Expand All @@ -528,6 +544,8 @@
trait :api_impot_particulier_carte_transport_sandbox do
api_impot_particulier
form_uid { 'api-impot-particulier-carte-transport-sandbox' }

with_dpd_homologation_checkbox
end

trait :api_impot_particulier_carte_transport_production do
Expand Down Expand Up @@ -575,6 +593,7 @@
with_cadre_juridique
with_modalities
with_scopes
with_dpd_homologation_checkbox
end

trait :france_connect do
Expand Down Expand Up @@ -624,6 +643,7 @@
with_basic_infos
with_personal_data
with_cadre_juridique
with_dpd_homologation_checkbox
end

trait :api_hermes_production do
Expand All @@ -649,6 +669,7 @@
with_basic_infos
with_personal_data
with_cadre_juridique
with_dpd_homologation_checkbox
end

trait :api_e_contacts_production do
Expand All @@ -674,6 +695,7 @@
with_basic_infos
with_personal_data
with_cadre_juridique
with_dpd_homologation_checkbox
end

trait :api_opale_production do
Expand All @@ -699,6 +721,7 @@
with_basic_infos
with_personal_data
with_cadre_juridique
with_dpd_homologation_checkbox
end

trait :api_ocfi_production do
Expand All @@ -724,6 +747,7 @@
with_basic_infos
with_personal_data
with_cadre_juridique
with_dpd_homologation_checkbox
end

trait :api_e_pro_production do
Expand All @@ -749,6 +773,7 @@
with_basic_infos
with_personal_data
with_cadre_juridique
with_dpd_homologation_checkbox
end

trait :api_robf_production do
Expand All @@ -774,6 +799,7 @@
with_basic_infos
with_personal_data
with_cadre_juridique
with_dpd_homologation_checkbox
end

trait :api_cpr_pro_adelie_production do
Expand All @@ -799,6 +825,7 @@
with_basic_infos
with_personal_data
with_cadre_juridique
with_dpd_homologation_checkbox
end

trait :api_imprimfip_production do
Expand All @@ -824,6 +851,7 @@
with_basic_infos
with_personal_data
with_cadre_juridique
with_dpd_homologation_checkbox
end

trait :api_satelit_production do
Expand All @@ -849,6 +877,7 @@
with_basic_infos
with_personal_data
with_cadre_juridique
with_dpd_homologation_checkbox
end

trait :api_mire_production do
Expand All @@ -874,6 +903,7 @@
with_basic_infos
with_personal_data
with_cadre_juridique
with_dpd_homologation_checkbox
end

trait :api_ensu_documents_production do
Expand Down

0 comments on commit b93f853

Please sign in to comment.