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 Store drop_down_list values as jsonb 2020-06-25 13:14:17 +02:00
administrateur_spec.rb remove dead code in admin model 2020-09-18 11:16:34 +02:00
assign_to_spec.rb models: require belong_to associations on assign_to 2020-08-18 15:57:36 +02:00
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 specs: always require rails_helper 2020-03-31 12:48:32 +02:00
champ_shared_example.rb models: require belong_to associations on champ 2020-08-18 15:57:37 +02:00
champ_spec.rb active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
commentaire_spec.rb Anonymisation de l'instructeur dans la messagerie 2020-05-18 12:56:30 +00:00
deleted_dossier_spec.rb DeletedDossier should have access to discarded demarche 2020-03-31 17:08:29 +02:00
dossier_spec.rb active_storage: refactor concerns 2021-03-16 11:49:14 +01:00
etablissement_spec.rb export bilans in ods and xlsx 2020-06-04 15:31:16 +02:00
exercice_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
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 specs: always require rails_helper 2020-03-31 12:48:32 +02:00
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 specs: always require rails_helper 2020-03-31 12:48:32 +02:00
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 specs: always require rails_helper 2020-03-31 12:48:32 +02:00
individual_spec.rb models: require belong_to associations on individual 2020-08-18 15:57:37 +02:00
instructeur_spec.rb Defaut groupe instructeur ordered by label 2021-03-04 10:35:44 +01:00
invite_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
procedure_overview_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
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 refuse les numéros de tel invalides 2019-12-04 05:34:43 +01:00
siret_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
super_admin_spec.rb superadmin: check complexity password server side 2020-12-15 16:26:09 +01:00
trusted_device_token_spec.rb models: require belong_to associations on trusted_device_token 2020-08-18 15:57:37 +02:00
type_de_champ_private_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
type_de_champ_shared_example.rb update models specs to use revisions 2020-09-02 11:26:26 +02:00
type_de_champ_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
user_spec.rb Add create expert method 2021-01-20 18:03:05 +01:00