demarches-normaliennes/spec/models
Pierre de La Morinerie 75a1046315 active_storage: refactor concerns
Follow-up of #5953.

Refactor the concerns with two goals:

- Getting closer from the way ActiveStorage adds its own hooks.
  Usually ActiveStorage does this using an `Attachment#after_create`
  hook, which then delegates to the blob to enqueue the job.
- Enqueuing each job only once. By hooking on `Attachment#after_create`,
  we guarantee each job will be added only once.

We then let the jobs themselves check if they are relevant or not, and
retry or discard themselves if necessary.

We also need to update the tests a bit, because Rails'
`perform_enqueued_jobs(&block)` test helper doesn't honor the `retry_on`
clause of jobs. Instead it forwards the exception to the caller – which
makes the test fail.

Instead we use the inline version of `perform_enqueued_jobs()`, without
a block, which properly ignores errors catched by retry_on.
2021-03-16 11:49:14 +01:00
..
champs Add champ address model 2021-02-17 19:10:16 +01:00
concern replace filter+first with find 2020-09-25 12:53:11 +00:00
types_de_champ
administrateur_spec.rb remove dead code in admin model 2020-09-18 11:16:34 +02:00
assign_to_spec.rb
attestation_template_spec.rb replace filter+first with find 2020-09-25 12:53:11 +00:00
avis_spec.rb instead of call Avis table, we now call Experts Procedure table to see the experts list 2021-01-26 13:59:10 +01:00
bill_signature_spec.rb spec: use real signature to avoid mocking 2020-12-14 14:09:15 +01:00
champ_private_spec.rb
champ_shared_example.rb
champ_spec.rb active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
commentaire_spec.rb
deleted_dossier_spec.rb
dossier_spec.rb active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
etablissement_spec.rb
exercice_spec.rb
expert_spec.rb add expert factory 2021-01-20 18:03:06 +01:00
experts_procedure_spec.rb change active record request to get expert list 2021-02-16 09:46:18 +00:00
export_spec.rb
france_connect_information_spec.rb disable france connect authentication for admin and instructeurs 2021-02-10 18:13:47 +01:00
france_connect_particulier_client_spec.rb
geo_area_spec.rb Remove a spec that was testing bug in libgeos 2021-02-23 10:35:30 +01:00
groupe_instructeur_spec.rb
individual_spec.rb
instructeur_spec.rb Defaut groupe instructeur ordered by label 2021-03-04 10:35:44 +01:00
invite_spec.rb
procedure_overview_spec.rb
procedure_presentation_spec.rb Groupe instructeur selector default blank 2021-03-09 14:47:23 +01:00
procedure_revision_spec.rb fix order of types de champ on procedure 2021-01-26 10:45:34 +01:00
procedure_spec.rb Groupe instructeur selector default blank 2021-03-09 14:47:23 +01:00
service_spec.rb
siret_spec.rb
super_admin_spec.rb superadmin: check complexity password server side 2020-12-15 16:26:09 +01:00
trusted_device_token_spec.rb
type_de_champ_private_spec.rb
type_de_champ_shared_example.rb
type_de_champ_spec.rb
user_spec.rb Add create expert method 2021-01-20 18:03:05 +01:00