Commit graph

108 commits

Author SHA1 Message Date
Pierre de La Morinerie
997c197980 specs: simplify the syntax of some factories 2021-11-23 08:07:07 +01:00
Pierre de La Morinerie
0e809ac1a2 specs: build the default groupe instructeur before the create callback
This allows for better ergonomics, by having the default groupe
instructeur available even before the procedure is saved.
2021-11-23 08:07:07 +01:00
Pierre de La Morinerie
032e3e2cb1 specs: create the procedure administrateur declaratively
It seems better to create associations in an declarative fashion, rather
than using imperative code. This also makes the attribute compatible
with build_stubbed.
2021-11-23 08:07:07 +01:00
Pierre de La Morinerie
970c3e4b2b specs: avoid executing business logic in Procedure factory
Calling business logic in a factory is a code-smell, because it
usually requires the object to be saved into database, and may have
unintended consequences when the business logic is changed.

Also, this allows to just build a published procedure, without saving it
to the database.
2021-11-23 08:07:07 +01:00
Pierre de La Morinerie
cedbd31d39 specs: only build an admin when building a procedure
This should slighly be faster than doing a create in the middle of the
build.
2021-10-26 12:03:30 +02:00
simon lehericey
ecc26897e2 add end to end spec 2021-10-12 14:27:20 +02:00
Paul Chavard
9e30d5fc22 fix(virus scan): prevent virus scans in specs 2021-09-07 14:21:48 +02:00
Christophe Robillard
8f2e0660d3 add spec for dossier with commune 2021-08-19 08:04:47 +02:00
simon lehericey
17617fba43 address champ needs the data column 2021-05-19 15:59:18 +02:00
Paul Chavard
84214f4bd4 Do not export non exportable champs on draft procedures 2021-03-23 09:55:37 +01:00
Paul Chavard
89ec3923f2 Defaut groupe instructeur ordered by label 2021-03-04 10:35:44 +01:00
Christophe Robillard
d55f156aec admin: durée de conservation des données hors ds n'est plus demandée
La colonne est tout de même gardée en base
2021-02-17 16:41:57 +01:00
simon lehericey
1159494d37 Add test to ensure no titre identite is exported 2020-12-16 17:31:38 +01:00
clemkeirua
a62907f33b add more tests for phone numbers 2020-09-09 09:00:03 +02:00
Paul Chavard
d1fb6c559e Update factories to use revisions 2020-09-02 11:26:26 +02:00
Pierre de La Morinerie
29e8c43e5e models: require belong_to associations on groupe_instructeur 2020-08-18 15:57:37 +02:00
Pierre de La Morinerie
6328011f60 models: require belong_to associations on champ
- Make `champ.dossier` a requirement;
- Move the dossier_id assignation to `before_validation` (otherwise
the record is invalid, and never gets saved);
- Allow specs to only build the champ (instead of saving it to the
database), which bypasses the requirement to have a dossier.
2020-08-18 15:57:37 +02:00
Pierre de La Morinerie
df2429d7ad factories: build type_de_champ instead of creating them
This allows to minimize the number of actual creations when only a
build is requested.
2020-08-13 17:39:49 +02:00
Pierre de La Morinerie
43569f687e specs: use fixture_file_upload rather than Rack::Test::UploadedFile
This is mostly for consistency (both styles were used before).

Note: we still have to use `Rack::Test::UploadedFile.new` in factories,
because of https://github.com/thoughtbot/factory_bot/issues/385.
2020-07-01 11:13:45 +02:00
clemkeirua
465449e684 fix unit tests 2020-06-24 12:18:56 +02:00
Judith
59346ee868 mailers: mention the auto_archive in notify_new_draft 2020-05-28 13:22:02 +00:00
Paul Chavard
876e05aed3 Discard demarches from manager 2020-03-31 17:08:28 +02:00
Paul Chavard
3cd4597006 Update rubocop roules 2020-03-17 11:25:21 +01:00
Paul Chavard
be66a8986c Activate champ integer number on all the new procedures 2020-02-25 11:26:37 +01:00
Paul Chavard
b7051da278 Remove old export code 2020-02-19 18:19:17 +01:00
Paul Chavard
1ce1c1e6d0 use discard 2020-02-13 12:31:59 +01:00
simon lehericey
4f317e84d1 Iterate over type_de_champ in repetition type_de_champ 2020-02-11 13:35:55 +00:00
Pierre de La Morinerie
52ea019ba9 app: replace remaining references of DINSIC by DINUM
Fix #4488
2020-02-10 17:46:20 +00:00
Paul Chavard
2f060fc30a Add depubliee state to procedures 2019-12-04 16:52:41 +01:00
Paul Chavard
7b947feae4 Rename demarche archivée to demarche close 2019-11-28 15:07:16 +01:00
clemkeirua
43424e4f4e merge with the work of paul, using 3 links 2019-10-22 09:51:14 +02:00
simon lehericey
18de25fac7 Display the dossier.groupe_instructeur.label on various screens 2019-10-17 15:48:14 +02:00
Nicolas Bouilleaud
c26a701a17 Refactor and redesign publish modal
* remove the autocomplete menu
* use ujs to pre-validate the procedure
* tweak the UI
2019-09-17 16:30:48 +02:00
Nicolas Bouilleaud
e9c6ed80e4 Migration: Index and make Procedure.path nonnull 2019-09-17 16:30:48 +02:00
Paul Chavard
7ffb98e616 Remove carrierwave uploaders 2019-09-10 10:49:12 +02:00
simon lehericey
d0bfb62fec Procedure Factory: use procedure.new_dossier 2019-09-03 06:47:02 +02:00
simon lehericey
31cb056351 Procedure: remove direct instructeurs access
Add shortcut for the spec to assign instructeurs directly to the defaut groupe
2019-09-02 11:41:12 +02:00
simon lehericey
b541ef0b41 Procedure has many instructeurs with defaut_groupe_instructeur 2019-09-02 11:41:12 +02:00
Paul Chavard
d02e0fc556 Fix and test migrate_procedure_logo task 2019-08-22 11:28:03 +02:00
Paul Chavard
cc35a04e26 Migrate procedure logo to active_storage 2019-08-21 11:15:00 +02:00
simon lehericey
3fde2a6f70 Rename gestionnaire in code to instructeur 2019-08-12 13:47:01 +02:00
Pierre de La Morinerie
ffe081c1f2 specs: remove old pieces_justificative from specs and factories 2019-07-30 16:11:17 +02:00
clemkeirua
314b0f5dc0 fix tests 2019-07-25 17:15:19 +02:00
clemkeirua
6f47655301 rendu lien_site_web obligatoire au moment de la publication 2019-07-25 15:46:04 +02:00
Pierre de La Morinerie
5bafda6619 factories: fix unmatching MIME type in fixtures 2019-07-17 14:43:41 +02:00
Pierre de La Morinerie
51aacabf13 models: fix touch not propagating when using nested attributes
Sometimes, when using nested attributes, touch doesn’t propagate to
parent relationships. (see https://github.com/rails/rails/issues/26726)

Specifically, this happens in our app when updating a dossier with
only new attachements (but without changing the value of any fields).

To work around this, we need to define the parent relationship
explicitely. This is good practice anyway.

Fix #3906
2019-06-17 13:44:07 +02:00
Mathieu Magnin
c550d40e3a [Fix #3064] Add preview test 2019-04-11 11:03:13 +02:00
Paul Chavard
bb8ba75d22 Explicitly pass current_administrateur on publish 2019-03-12 11:59:01 +01:00
Paul Chavard
c37f649453 Update specs to use multiple administrateurs 2019-03-12 11:59:01 +01:00
Paul Chavard
84383fc3c1 Assigne admins to procedure.administrateurs 2019-02-20 17:10:57 +01:00