demarches-normaliennes/spec/models
Pierre de La Morinerie e6cf07b810 stats: move date formatting out of the Stat model
Before this commit, the monthly dossiers count was serialized into the
Stat record using human-formatted dates, as:

```ruby
s.dossiers_in_the_last_4_months = {
  "octobre 2021"=>409592,
  "novembre 2021"=>497823,
  "décembre 2021"=>38170,
  "janvier 2022"=>0
}
```

Turns out the ordering of keys in a serialized hash is not guaranteed.
After a round-trip to the database, the keys will be wrongly sorted.

Instead we want to save raw Date objects, which will preserve the
ordering. The date formatting can be applied at display-time by the
controller.

Fix #6848
2022-02-02 14:13:53 +01:00
..
champs feat(api particulier): add MESRI field 2021-12-16 16:45:18 +01:00
concern fix(dossier): use depose_at instead of en_construction_at 2021-12-06 15:49:17 +01:00
types_de_champ add code insee libelle for commune export 2021-08-19 08:04:47 +02:00
administrateur_spec.rb factories: cleanup Administrateur, Instructeur and Expert factories 2021-10-26 12:03:30 +02:00
archive_spec.rb Revert "Revert "Export de tous les dossier d'une démarche"" 2021-04-29 17:29:47 +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 experts_procedure should not be optional 2021-03-23 13:46:33 +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 Improuve champ blank check 2021-07-22 10:45:25 +02:00
champ_spec.rb format phone numbers 2021-06-15 09:14:55 +02:00
commentaire_spec.rb refactor(mail.delay): use simplier implementation using after_action to prevent email delivery with delay 2021-11-16 15:12:05 +01:00
deleted_dossier_spec.rb specs: remove unused require 2021-03-25 13:24:53 +01:00
dossier_spec.rb tests 2022-01-25 11:46:05 +01:00
dossier_transfer_spec.rb fix(transfer): manually nullify staled transfers references 2021-10-21 13:54:26 +02: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 case when the old_expert or old_instructeur is nil 2021-10-12 11:04:06 +02:00
experts_procedure_spec.rb experts_procedure should not be optional 2021-03-23 13:46:33 +01:00
export_spec.rb Add last_month export 2021-06-23 09:23:10 +02:00
france_connect_information_spec.rb associate_user take a target email 2021-10-14 14:47:50 +02:00
france_connect_particulier_client_spec.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
geo_area_spec.rb specs: avoid creating uneeded champs on geo_area 2021-10-26 12:03:30 +02:00
groupe_instructeur_spec.rb fix(instructeur): copy notifications settings from previous groupe instructeur 2021-12-23 13:55:25 +01:00
individual_spec.rb models: require belong_to associations on individual 2020-08-18 15:57:37 +02:00
instructeur_spec.rb fix(instructeur): copy notifications settings from previous groupe instructeur 2021-12-23 13:55:25 +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_and_revisions_spec.rb specs: minor cleanups 2021-11-23 08:07:07 +01:00
procedure_presentation_spec.rb fix(dossier): use depose_at instead of en_construction_at 2021-12-06 15:49:17 +01:00
procedure_revision_spec.rb fix(revision): changed? conflicts with rails method 2022-01-19 18:00:37 +01:00
procedure_spec.rb validators: rename revisions namespace to types_de_champ 2022-02-01 12:37:16 +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
stat_spec.rb stats: move date formatting out of the Stat model 2022-02-02 14:13:53 +01:00
super_admin_spec.rb models: improve password complexity specs 2021-09-09 09:40:39 -05:00
traitement_spec.rb archives: count archived dossiers 2021-06-18 08:59:13 +02: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 include hidden dossier in merge 2021-11-15 23:14:41 +01:00