Commit graph

243 commits

Author SHA1 Message Date
clemkeirua
590cee050f add tests for dossier_search_service 2020-04-09 09:42:31 +02:00
Paul Chavard
ca6c97bf0f Refactor expired dossiers deletion service 2020-04-02 15:24:02 +02:00
Paul Chavard
7ba4c513e6 Refactor notify near deletion mailers 2020-04-01 17:40:52 +02:00
Pierre de La Morinerie
4cb747fdb6 specs: always require rails_helper
Test helpers are separated between two files: spec_helper and
rails_helper. This separation is meant to allow tests that do not
require Rails (like testing standalone libs) to boot faster.

The spec_helper file is always loaded, through `--require spec_helper`
in the `.rspec` config file. When needed, the rails_helper file is
expected to be required manually.

This is fine, but:
- Many test files have a redundant `require 'spec_helper'` line;
- Many test files should require `rails_helper`, but don't.

Not requiring `rails_helper` will cause the Rails-concerned section of
the test environment not to be configured–which may cause subtle bugs
(like the test database not being properly initialized).

Moreover, Spring loads all the Rails files on preloading anyway. So the
gains from using only `spec_helper` are thin.

To streamline this process, this commit:
- Configures `.rspec` to require `rails_helper` by default;
- Remove all manual requires to spec_helper or rails_helper.

Reference: https://stackoverflow.com/questions/24145329/how-is-spec-rails-helper-rb-different-from-spec-spec-helper-rb-do-i-need-it
2020-03-31 12:48:32 +02:00
Paul Chavard
c40d689edf Use bigger deltas to allow for month length variations 2020-03-31 11:50:59 +02:00
Paul Chavard
5b5ae5a7a5 Do not send notifications or create operation logs on brouillon demarches 2020-03-25 15:04:52 +01:00
Paul Chavard
5c2eba1dd1 Always add a reason to dossier deletion 2020-03-24 09:30:11 +01:00
Paul Chavard
cd0acb1344 Cleanup dossier mailers 2020-03-19 16:52:18 +01:00
simon lehericey
3dd4ea26c7 add similar tests for send_brouillon_expiration_notices and delete_expired_brouillon_and_notify 2020-03-18 15:25:02 +01:00
simon lehericey
3f6012bff5 Delete complicated test 2020-03-18 15:25:02 +01:00
simon lehericey
74db7ab146 test for #send_en_construction_expiration_notices 2020-03-18 15:25:02 +01:00
simon lehericey
f35c0518b7 test for #delete_expired_en_construction_and_notify 2020-03-18 15:25:02 +01:00
Paul Chavard
fe1cd2a47b Delete and notify en_construction dossiers 2020-03-18 15:25:02 +01:00
Paul Chavard
f35ccc9d92 Move process_expired_dossiers_brouillon to a service 2020-03-18 15:25:02 +01:00
kara Diaby
395af2fbb0 instructors : receive daily emails for declarative folders 2020-03-17 15:54:50 +01:00
Paul Chavard
c281347da1 Remove restclient 2020-03-17 11:12:14 +01:00
kara Diaby
4a70a7fcc8 remove email_notifications_enabled column because of the new daily_email_notifications_enabled 2020-02-27 11:09:19 +01:00
clemkeirua
fcea7c4f85 remove invalid excel worksheet characters 2020-01-29 11:45:56 +01:00
Paul Chavard
eec38bad73 Ajouter les informations de l’instructeur et de l’expert dans l’export des avis
fix #4667
2020-01-28 15:09:41 +01:00
Pierre de La Morinerie
724ff50363 factories: rename dossier for_individual to with_individual
This clarifies the distinction between

```
create :procedure, :for_individual
```

and

```
create :dossier, :with_individual
```
2020-01-21 17:24:56 +01:00
Paul Chavard
14295db9ad Revert "Revert "Merge pull request #4552 from tchak/champ-communes""
This reverts commit 4373cb22cb.
2020-01-14 18:46:07 +01:00
clemkeirua
4373cb22cb Revert "Merge pull request #4552 from tchak/champ-communes"
This reverts commit 4cec26f73a, reversing
changes made to 0ef25ef36c.
2020-01-13 16:26:27 +01:00
Paul Chavard
4bbd16576b Add champ communes 2020-01-07 11:52:51 +01:00
maatinito
9672d892e9 Bug with time zone: Time.zone.today looses time_zone and may breaks database comparisons 2019-12-11 17:34:10 +01:00
Paul Chavard
7b947feae4 Rename demarche archivée to demarche close 2019-11-28 15:07:16 +01:00
maatinito
9de9a1fd71 Use time.zone functions instead of server time functions
(Time.zone.today vs Date.today)
2019-11-26 14:26:36 +01:00
Paul Chavard
0c6705f7fd Drop old export service 2019-11-21 10:25:40 +01:00
Paul Chavard
f22b39b7c5 Handle non unique champ repetable labels
fix #4466
2019-11-07 14:27:52 +01:00
Paul Chavard
2a61ed5b1c Export etablissement information in csv
fix #4440
2019-11-07 14:27:52 +01:00
Paul Chavard
839b0d7e6d Add Entreprise raison sociale to dossier export
fix #4422
2019-10-31 17:11:46 +01:00
simon lehericey
8ae592fe25 [fix #4361] administrateur active 2019-10-24 18:32:48 +02:00
simon lehericey
a2f82ab8be Add groupe_instructeur_label to export v2 2019-09-19 12:30:12 +02:00
simon lehericey
f577484aa2 Add groupe_instructeur_label to export v1 2019-09-19 12:30:12 +02:00
simon lehericey
8660d4af30 Instructeur: only export its dossiers 2019-09-19 12:24:40 +02:00
Paul Chavard
8a691d534a Fix AdministrateurUsageStatisticsService 2019-09-17 12:37:37 +02:00
Paul Chavard
c370c2f475 Cleanup FlipFlop 2019-09-10 23:52:44 +02:00
Paul Chavard
3eb3ae001e Rename “Passé en construction le” to 'Déposé le' for clarity 2019-09-10 14:59:10 +02:00
simon lehericey
6cbdba2665 Dossier Factory: link procedure by defaut_groupe_instructeur
Oblige to create procedure or dossier to access groupe_instructeur
2019-09-03 06:47:02 +02:00
simon lehericey
caf1fbca44 Use assign_to 2019-09-02 11:41:12 +02:00
Paul Chavard
15148a4fe1 Fix invalid characters in repetition champs sheet_name for xls export 2019-08-28 10:47:58 +02:00
simon lehericey
eb2ebee16e fix flaky spec in ip_service_spec 2019-08-20 16:41:32 +02:00
simon lehericey
b7f8bb2fea Simplify ip_service 2019-08-20 13:29:29 +02:00
simon lehericey
3fde2a6f70 Rename gestionnaire in code to instructeur 2019-08-12 13:47:01 +02:00
Paul Chavard
8c72470a6c Add default etablissement champ name 2019-07-30 17:17:36 +02:00
Paul Chavard
5a9468aa95 Fix repetition data export 2019-07-30 17:17:36 +02:00
Pierre de La Morinerie
e975fe4ade tasks: remove task to migrate old pieces justificatives 2019-07-30 16:11:17 +02:00
Pierre de La Morinerie
5502f2e42e dossier: remove UI for uploading old pieces justificatives 2019-07-30 16:11:16 +02:00
Pierre de La Morinerie
80efe27ff2 pj migration: retry when changing the content type fails 2019-07-16 17:51:29 +02:00
clemkeirua
25f81f1d3c download a dossier as zip with all attachments 2019-07-16 09:11:25 +02:00
simon lehericey
7b63ddfabb Better champs factories 2019-07-10 16:41:34 +02:00
Paul Chavard
3cb39c2840 Refactor message attachements to use active_storage 2019-07-10 15:35:29 +02:00
Paul Chavard
ad0a74ea7c Fix dates in dossiers export 2019-07-09 10:02:08 +02:00
Chaïb Martinez
39a2eb77e8 test fix
Signed-off-by: Chaïb Martinez <chaibax@gmail.com>
2019-07-08 14:58:32 +02:00
Paul Chavard
fb0ef15e3c Export dossiers v2 2019-07-02 14:20:29 +02:00
Chaïb Martinez
36114c07a9 Add some test to admin roi calculation
[fix #3986]

Signed-off-by: Chaïb Martinez <chaibax@gmail.com>
2019-07-01 11:13:36 +02:00
Nicolas Bouilleaud
bd47bf2691 Disable Messagerie in archived Dossiers and procedures
* Use the existing Dossier#messagerie_available? method
* Raise when attempting to build a Commentaire if not messagerie_available?
* Disable the Messagerie form if not messagerie_available?
* Add tests :)
* Tweak the Horaires formatting while we’re here.
2019-07-01 09:39:39 +02:00
Pierre de La Morinerie
50cf6059e6 tasks: ensure creating an empty champ doesn’t display a notification 2019-06-24 15:49:02 +02:00
Pierre de La Morinerie
d561936863 task: ensure that hidden dossiers are rolled back 2019-06-20 10:48:56 +02:00
Pierre de La Morinerie
f8dda3ae45 tasks: don't abort rollback when a dossier fails
Instead print a warning, and continue rolling back the other dossiers.
2019-06-20 10:31:23 +02:00
Nicolas Bouilleaud
ad3553f0be Add BillSignature Service 2019-06-17 16:16:28 +02:00
Pierre de La Morinerie
f12668fbfb tasks: prevent the PJ migrations task updating from touching dossiers 2019-06-12 19:07:45 +02:00
Pierre de La Morinerie
6cb02f2927 pj migration: handle signal interrupts 2019-05-29 14:46:49 +02:00
Pierre de La Morinerie
10df7b70ee carrierwave: when migrating, create an empty blob if file is missing 2019-05-28 18:19:33 +02:00
Pierre de La Morinerie
44c410d40d piece_justificative_service: fix for missing order_place
In production some pieces justificatives don't have an order place.

In this case, insert the champs after the ones that have an order place.
2019-05-28 17:20:07 +02:00
Pierre de La Morinerie
52b7a82932 services: mark attachments migrated from CarrierWave as safe
This avoids to enqueue thousands of scans when migrating the PJs of
a whole procedure.
2019-05-28 11:39:22 +02:00
Pierre de La Morinerie
4cf54e0d28 tasks: add progress report to the pjs migration task
Progress is indicated per migrated champ.
2019-05-28 10:42:18 +02:00
Paul Chavard
3446782cd0 Remove deprecated editor 2019-05-14 16:18:29 +02:00
Paul Chavard
96b3547788 Exercices and RNA information are optional and should not block the request 2019-05-03 18:23:21 +02:00
simon lehericey
e65e21a72f Email notification: use the right method for procedures 2019-04-18 15:07:01 +02:00
simon lehericey
52e6632175 Add IPService 2019-04-03 15:21:19 +02:00
Frederic Merizen
9aebb76e77 [#2180] Avoid sending spurious notifications to instructeurs 2019-03-27 17:36:13 +01:00
Frederic Merizen
7d316b8369 [#2180] High-level PJ to champ PJ migration service 2019-03-27 17:36:13 +01:00
Frederic Merizen
e24242e4b2 [#2180] Low-level Carrierwave to ActiveStorage migration 2019-03-27 17:36:13 +01:00
Frederic Merizen
21dbe44e07 [#2180] Fix ordering of piece jointe champs 2019-03-27 17:36:13 +01:00
Paul Chavard
69a51e3296 Save SIRET data on search 2019-03-19 16:22:42 +01:00
simon lehericey
6607de4827 Notification: add service to send notifications 2019-03-18 16:37:51 +01:00
Frederic Merizen
6b0832047b Service that computes administrator statistics and sends them to SendinBlue 2019-03-08 16:33:28 +01:00
Mathieu Magnin
f6714cd9a3 If ClamavService fails then raise an error 2019-02-05 17:58:41 +01:00
Pierre de La Morinerie
437f73b4ce search: exclude more special characters 2019-01-22 17:16:49 +01:00
Pierre de La Morinerie
98127b6778 signature: refactor specs 2019-01-03 17:48:53 +01:00
gregoirenovel
baf7977786 Enable the Lint/StringConversionInInterpolation cop 2019-01-03 10:53:50 +01:00
Paul Chavard
eb9edc1cee Order types de champ in scope 2018-12-20 14:14:15 +01:00
Paul Chavard
5d1c24f3d8 Add type de champ repetition models (with row) 2018-12-19 15:31:11 +01:00
gregoirenovel
df7e0a9881 Remove dead code 2018-12-19 14:59:15 +01:00
Frederic Merizen
57a136c861 Make champ PJ generally available 2018-12-18 11:11:23 +01:00
simon lehericey
5a87fad02e [fix #3154] order export 2018-12-10 16:41:37 +01:00
Paul Chavard
35494df78e Procedure export dossiers with champs siret 2018-12-05 17:09:39 +01:00
Paul Chavard
a08f170dbd Assign users and gestionnaires to commentaires
fix #2052
2018-12-05 13:40:57 +01:00
Paul Chavard
37a7e26fc3 Remove unused users/carte_controller 2018-11-27 16:11:25 +01:00
Paul Chavard
1c87eda6e1 Move types_de_champ helper to service 2018-11-07 11:36:10 +01:00
Paul Chavard
2d647f9fa7 Move types_de_champ facade to service 2018-11-07 11:36:10 +01:00
Paul Chavard
cfd1950e17 Migrate commencer to new_user 2018-11-01 13:10:41 +01:00
simon lehericey
9475795143 fix spec 2018-10-26 10:10:20 +00:00
simon lehericey
f620e4aee2 DateTime.parse => Time.zone.parse 2018-10-26 10:10:20 +00:00
Frederic Merizen
447e54fe45 [Fix #2874] Allow archived dossiers to appear in search results 2018-10-18 16:05:19 +02:00
gregoirenovel
baf69acbcb [Fix #2833] Move /support files to /fixtures 2018-10-16 10:47:41 +02:00
Frederic Merizen
9fa7a6fd0e [#2750] Move get_value to ProcedurePresentation 2018-10-10 09:07:57 +02:00
Frederic Merizen
fc157c3e4c [#2750] Move sorted_ids to ProcedurePresentation 2018-10-10 09:07:57 +02:00
Frederic Merizen
2e9dafb4c3 [#2750] Move filtered_ids to ProcedurePresentation 2018-10-10 09:07:57 +02:00
Frederic Merizen
eafd0e8348 Evite de cacher la whitelist trop longtemps 2018-10-04 18:09:39 +02:00