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
Christophe Robillard
f587e6600a
extract class ApiEntrepriseToken
...
and check if token is expired
2020-05-06 10:57:45 +02:00
Christophe Robillard
ddd3e6bb02
don't copy api_entreprise_token when cloning
...
except for an admin who owns the parent procedure
2020-04-29 17:17:20 +02:00
Paul Chavard
e512870fd2
Cleanup procedure duree_conservation_dossiers_dans_ds validations
2020-04-16 19:40:19 +02:00
clemkeirua
ed45c88bdf
do not clone groups instructeurs for admin outside the procedure
2020-04-07 09:25:40 +02:00
pedong
7806a26e2c
copy groupe_instructeurs when clone
2020-04-07 09:22:33 +02:00
Paul Chavard
876e05aed3
Discard demarches from manager
2020-03-31 17:08:28 +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
kara Diaby
1f27652cd3
add files validations to models
2020-03-23 11:28:13 +01:00
Paul Chavard
24d237de9e
A cloned procedure should not have canonical relationship
2020-02-25 15:26:43 +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
Pierre de La Morinerie
1448d5b098
models: add a Procedure#with_hidden scope, and remove unscoped
usages
...
This avoids the broad use of `unscoped` to remove the `hidden_at`
clause.
2020-01-28 17:32:38 +01:00
Paul Chavard
67dea1ee50
Update spec/models/procedure_spec.rb
...
Co-Authored-By: Pierre de La Morinerie <kemenaran@gmail.com>
2020-01-28 12:49:53 +01:00
Paul Chavard
517ab25783
Register canonical procedure when demarche republished under existing path
2020-01-28 12:49:53 +01: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
Paul Chavard
3e334a3306
Drop test_started_at
...
# Conflicts:
# spec/models/procedure_spec.rb
2019-11-28 14:17:47 +01:00
Pierre de La Morinerie
a458693a19
specs: fix #usual_traitement_time tests when near the DST date
2019-11-04 10:56:15 +01:00
Pierre de La Morinerie
a462edb9bc
instructeurs: alias instructeur.email
...
This also means we need to replace instances of `pluck` on the email
column.
2019-11-04 10:44:24 +01:00
clemkeirua
43424e4f4e
merge with the work of paul, using 3 links
2019-10-22 09:51: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
bd1e0aba38
Add Procedure path suggestion
2019-09-17 16:30:48 +02:00
simon lehericey
b541ef0b41
Procedure has many instructeurs with defaut_groupe_instructeur
2019-09-02 11:41:12 +02:00
simon lehericey
ba24958035
Procedure add missing_instructeurs?
2019-09-02 11:41:12 +02:00
simon lehericey
115d91387c
A procedure has a default groupe instructeur
2019-09-02 11:41:12 +02:00
clemkeirua
188e0fd6b2
removed ask_birthday for new procedures & dossiers
2019-08-27 15:32:17 +02:00
simon lehericey
3fde2a6f70
Rename gestionnaire in code to instructeur
2019-08-12 13:47:01 +02:00
Pierre de La Morinerie
0da0a2b446
model: remove support for cloning procedures with old pj
2019-07-30 16:11:17 +02:00
Nicolas Bouilleaud
b066ccbc89
Make sure Procedure.path is not null in our data
2019-07-29 13:53:33 +02:00
clemkeirua
6f47655301
rendu lien_site_web obligatoire au moment de la publication
2019-07-25 15:46:04 +02:00
clemkeirua
6d43465ee5
renammed into monavis_embed
2019-07-17 18:04:32 +02:00
clemkeirua
c8f9e3b5f8
automated test
2019-07-17 18:04:32 +02:00
Nicolas Bouilleaud
df865e71dc
Make sure that there always is at least one administrator per Procedure
2019-05-06 16:19:08 +02:00
Pierre de La Morinerie
d855468cb6
dossiers: display the estimate of the entire processing time
...
Displaying separate estimations for en_construction and en_instruction
doesn't really make sense for the users: they want to know how
long it is going to take overall, not the petty details of our workflow.
2019-04-30 15:56:27 +02:00
Pierre de La Morinerie
e34c556f29
procedure: fix specs
...
When the time computations are done accross a Daylight Saving Time
change, they may be off by one hour.
It doesn't matter, as the estimated delay is counted in days, not
hours.
2019-04-08 15:24:44 +02:00
Paul Chavard
639facaf2a
Add new types_de_champ#move api
2019-04-03 14:38:07 +02:00
Mathieu Magnin
27c8e9dcb8
Use the same clone_attachment method for all attributes on procedure.clone
2019-03-28 17:17:29 +01:00
Mathieu Magnin
4e27872a25
[ Fix #3650 ] when cloning a procedure, do not forget pj_templates
2019-03-26 15:31:09 +01:00
Pierre de La Morinerie
b1a7018d30
procedure: ignore bad data when computing usual_instruction_time
...
Fix #3655
2019-03-20 17:48:54 +01:00
Pierre de La Morinerie
ed1f6ec38d
procedure: fix verification delay
...
The verification delay was ignoring all dossiers not closed yet.
2019-03-19 15:51:51 +01: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
Mathieu Magnin
44f28ec565
Remove feature flag for publish draft
2019-03-12 11:26:07 +01:00
Paul Chavard
84383fc3c1
Assigne admins to procedure.administrateurs
2019-02-20 17:10:57 +01:00
Frederic Merizen
5e37400834
[ #2180 ] Only retain old PJ API when cloning for same admin
2019-01-17 17:40:40 +01:00
Frederic Merizen
530079e464
[ #2180 ] Make sure that old_pj is kept through successive clones
2019-01-17 17:40:40 +01:00
Frederic Merizen
8cb509d192
[ #2180 ] Keep information that this type de champ was cloned from a PJ
2019-01-17 17:40:40 +01:00
Frederic Merizen
651fd6149b
[ #2180 ] When cloning a procedure, convert types de PJ to types de champ PJ
2019-01-17 17:40:40 +01:00
simon lehericey
a197285742
[ fix #2612 ] Admin: add missing steps to admin UI
2019-01-09 16:25:00 +01:00
simon lehericey
8ca7eb1c54
Procedure: cloning set the current admin gestionnaire of the procedure
2019-01-09 16:25:00 +01:00
Pierre de La Morinerie
d77530c461
Make Procedure state consistent after switching types de champ order
...
Fixes an issue where, after clicking the "move champ up" button,
the new form is rendered with an incoherent order.
2019-01-03 15:13:14 +01:00
gregoirenovel
386fbce776
Enable the Layout/SpaceBeforeBlockBraces cop
2019-01-03 10:53:50 +01:00
Mathieu Magnin
b40c706d98
[ Fix #3192 ] Clone service if procedure is transferred
2018-12-20 15:45:48 +01:00
Paul Chavard
eb9edc1cee
Order types de champ in scope
2018-12-20 14:14:15 +01:00
pedong
f70f276ae9
[ fix #2813 ] set lien_notice nil when clone a procedure
2018-12-06 21:28:08 +01:00
Paul Chavard
35494df78e
Procedure export dossiers with champs siret
2018-12-05 17:09:39 +01:00
Paul Chavard
1883c57c87
Add stable ids to types_de_champ after every update
2018-11-29 11:41:13 +01:00
Paul Chavard
36f6f54337
Remove unused carto models
2018-11-27 16:11:25 +01:00
Pierre de La Morinerie
b6521625e4
procedure_spec: add missing Timecop.return statement
...
Fix order-dependant test.
2018-11-14 14:49:41 +01:00
Pierre de La Morinerie
83031b5cdd
procedure: compute the usual instruction time only for the last month
2018-11-13 17:23:31 +01:00
Pierre de La Morinerie
b693e055b7
procedure: make usual_instruction_time spec more robust
2018-11-13 17:23:31 +01:00
Pierre de La Morinerie
b1296df4c3
procedure: refactor usual_instruction_time spec
2018-11-13 17:23:31 +01:00
Pierre de La Morinerie
e59bec51ef
procedure: use 90th percentile to estimate the completion delay
2018-11-08 18:29:17 +01:00
Pierre de La Morinerie
5c921182ea
procedure: rename mean_instruction_time
to usual_instruction_time
...
Ref #2970
2018-11-08 17:20:06 +01:00
Paul Chavard
78dc582588
Remove ProcedurePath
2018-10-30 12:01:45 +01:00
simon lehericey
3078b377c7
Time.new => Time.zone.local
2018-10-26 10:10:20 +00:00
simon lehericey
f620e4aee2
DateTime.parse => Time.zone.parse
2018-10-26 10:10:20 +00:00
simon lehericey
2238e5bd9f
Time.now => Time.zone.now
2018-10-26 10:10:20 +00:00
Paul Chavard
93ef0a02b7
Remove unused lien_demarche from procedure
2018-10-23 09:25:29 +02:00
gregoirenovel
baf69acbcb
[ Fix #2833 ] Move /support files to /fixtures
2018-10-16 10:47:41 +02:00
Frederic Merizen
0e9b40ccf6
[ #2750 ] Move fields from Procedure to ProcedurePresentation
2018-10-10 09:07:57 +02:00
Frederic Merizen
efcac5192a
[ #2750 ] Move fields_for_select to ProcedurePresentation
2018-10-10 09:07:57 +02:00
gregoirenovel
12f0c99b5a
Remove FC fields from instructeur table customisation
2018-10-04 13:54:07 +02:00
gregoirenovel
7e4268db67
Enable Style/TrailingCommaInArguments
2018-10-03 12:03:21 +02:00
simon lehericey
6725c5e34c
Procedure: add test on mean_instruction_time
2018-09-27 15:02:38 +02:00
Frederic Merizen
1419e9b73f
[ #2622 ] Change sort to proper JSONB
2018-09-24 19:39:01 +02:00
gregoirenovel
4b071ecf06
Use enum to the fullest with Dossier.states
2018-08-29 17:31:08 +02:00
gregoirenovel
2d3b553e4d
Use enum to the fullest with TypeDeChamp.type_champs
2018-08-29 17:31:08 +02:00
Pierre de La Morinerie
b0a9e49549
procedures: group new_from_existing list by organization
...
As procedures are not grouped by Service (which are unique to an
administrator) but by organization, this allows procedures with the same
organization name to be displayed together.
2018-07-03 23:43:42 +02:00
Frederic Merizen
346687bd33
[ #1946 ] Once durees de conservation have been set, forbid unsetting them
2018-06-01 16:46:39 +02:00
Frederic Merizen
42765efb91
[ #1946 ] Add validation to durees conservation
2018-06-01 16:46:39 +02:00
simon lehericey
c72421fb9e
Procedure: Once deliberation or cadre_juridique have been set, forbid unsetting them
2018-06-01 11:12:53 +02:00
simon lehericey
1f0e46a4ff
Procedure: required juridique stuff only if needed
2018-06-01 11:12:53 +02:00
simon lehericey
fa14db1cbf
Procedure: add deliberation
2018-05-31 16:56:28 +02:00
Paul Chavard
87d7bd4fb2
Fix clone procedure
2018-05-28 14:58:40 +02:00
Paul Chavard
ad24fd5991
Remove entreprise and rna_information models
2018-05-24 17:54:51 +02:00
Paul Chavard
7fb7d77886
Use aasm_state in scopes
2018-05-24 17:49:24 +02:00
Paul Chavard
7070b0aba0
Fix tests to rely on aasm states
2018-05-23 16:31:27 +02:00
simon lehericey
928227a610
Procedure: remove now duplicate organisation and direction
2018-05-18 16:21:27 +02:00
simon lehericey
30513bcb4f
Procedure Clone: ensure the service is kept
2018-05-18 16:21:26 +02:00
simon lehericey
c90ddb92a6
Procedure: add #new_dossier
...
Create a new instance of a dossier and its champs without saving them in the db
2018-04-24 16:49:42 +02:00
simon lehericey
9d0b568ef5
Procedure: add parent_procedure
2018-04-24 15:48:20 +02:00
simon lehericey
f46bf5a67e
Procedure: procedure cloned from library are tagged
2018-04-24 14:22:22 +02:00
Frederic Merizen
809638df79
[ #1563 ] Determine if Attestation and Closed mail are out of sync
2018-04-06 10:18:56 +02:00
Frederic Merizen
3e56b6fe9b
[ #1563 ] Include attestation link in default closed mail when it makes sense
2018-04-04 10:44:40 +02:00
Paul Chavard
9cc6d494a4
Spec STI loading champ/type de champ
2018-03-29 17:45:19 +02:00
Frederic Merizen
13d251d970
describe '#method' rather than describe '.method' for instance methods
2018-03-20 16:00:30 +01:00
Mathieu Magnin
621f8143bd
[ Fix #1654 ] Generate procedure export filename with libelle
2018-03-19 11:16:05 +01:00
gregoirenovel
0a9f442260
Enable some Rails cops
2018-03-06 17:18:44 +01:00
gregoirenovel
e26f4148ff
Bump development gems
...
- brakeman
- rubocop
- scss_lint
2018-03-06 16:17:22 +01:00
gregoirenovel
fe7f8da636
Revert "Bump development gems"
...
This reverts commit d6ad3fc3fd
.
2018-03-06 15:11:26 +01:00
gregoirenovel
d6ad3fc3fd
Bump development gems
...
- brakeman
- rubocop
- scss_lint
2018-03-06 10:36:35 +01:00
Paul Chavard
0c1d529b61
Unify :type_de_champ public/private factories
2018-02-14 11:49:06 +01:00
gregoirenovel
08ed400ec2
Enable the Layout/FirstArrayElementLineBreak cop
2018-01-15 22:14:38 +01:00
gregoirenovel
093d853ecc
Fix some buggy error handling code in Admin::ProcedureController#clone
2018-01-09 11:05:19 +01:00
gregoirenovel
ec5b9c86ce
Add the admin argument to Procedure#clone
2018-01-08 14:55:07 +01:00
Frederic Merizen
8d77cd58c6
[ #1110 ] Make linked procedure available to mail model
2018-01-05 12:48:07 +01:00
Simon Lehericey
a13256f73d
[ fix #504 ] Dossier: closed -> accepte
2017-12-15 12:10:54 +01:00
Simon Lehericey
72bae2c374
[ fix #504 ] Dossier: draft -> brouillon
2017-12-15 11:52:09 +01:00
LeSim
56545933a9
[ fix #504 ] Dossier: initiated -> en_construction
...
The change must not impact the api
2017-12-15 11:52:09 +01:00
gregoirenovel
e26911a47a
An Etablissement’s libelle is its Libellé NAF, not its name
2017-12-07 16:26:59 +01:00
Simon Lehericey
d90e22e332
Tests: add (or group) Timecop.return to resume time in specs
2017-11-29 16:07:39 +01:00
gregoirenovel
731e1b6787
[ Fix #164 ] Make the organisme field mandatory
2017-11-29 10:36:22 +01:00
Simon Lehericey
ffe131322e
Dossier: prove a hidden dossier is no more followed
2017-10-05 16:59:26 +02:00
gregoirenovel
a611cace5f
Do not allow to filter by explication fields
2017-10-05 14:46:09 +02:00
gregoirenovel
3df9356021
Add field sort to the dossiers table
2017-10-02 17:45:22 +02:00
gregoirenovel
e1bdbec815
Allow the customization of the dossiers table
2017-10-02 17:45:22 +02:00
Simon Lehericey
633b55aca0
[ Fix #503 ] Dossier: remove replied
2017-09-26 14:42:54 +02:00
Mathieu Magnin
b0c0477622
[ Fix #315 ] Order champs by procedure order in export
2017-07-19 16:31:30 +02:00
gregoirenovel
32e0fa9f69
Add Procedure#publiee_ou_archivee?
2017-07-13 17:01:39 +02:00
gregoirenovel
36bee67085
Add Procedure#brouillon?
2017-07-13 17:01:38 +02:00
gregoirenovel
9a7d5d1833
Add Procedure#publiee?
2017-07-13 15:44:18 +02:00
gregoirenovel
cfec05506a
Rename Procedure#archived? -> #archivee?
2017-07-13 15:32:13 +02:00
gregoirenovel
bb10e13e2f
[Ref #145 ] Don't use Procedure.archived anymore
2017-07-11 15:03:35 +02:00
gregoirenovel
f55b7914cf
[Ref #144 ] Don't use Procedure.published anymore
2017-07-11 14:51:43 +02:00
Mathieu Magnin
e51e5afe55
Fix tests that often fail on circle ci when comparing datetimes
2017-07-04 17:17:14 +02:00
Mathieu Magnin
be3304f71e
Add a scope to Dossier to check if procedure is not hidden
2017-07-04 14:34:16 +02:00
Mathieu Magnin
760efcdad3
Add hidden_at on procedure
2017-07-04 14:33:40 +02:00
gregoirenovel
6b90e0ccfa
[Ref #145 ] Record archived_at when archiving a procedure
2017-07-03 10:18:49 +02:00
gregoirenovel
53b94e0017
Remove tests that test nothing
2017-07-03 10:18:48 +02:00
gregoirenovel
aeeb0dd22f
[ Fix #170 ] Keep drop down menu values for annot. privées when cloning
2017-06-27 14:31:33 +02:00
gregoirenovel
cf5398fe99
Record published_at when publishing a procedure
2017-06-27 13:55:17 +02:00
gregoirenovel
99ee68451a
Add proper tests for Procedure#publish!
2017-06-27 13:55:15 +02:00
gregoirenovel
68b9cd209d
Remove tests that were just testing if Rails worked
2017-06-27 13:55:06 +02:00
Simon Lehericey
d7ff3d6139
[ Fix #196 ] AttestationTemplate: add model
2017-06-16 11:35:13 +02:00
gregoirenovel
f1907f4d0e
Enable the Layout/EmptyLinesAroundBlockBody cop
2017-06-13 10:35:23 +02:00
gregoirenovel
ec69086ebc
Don’t use alias_method_chain, use a proxy method
2017-06-08 12:22:48 +02:00
gregoirenovel
bc7fc2634e
Fix test indentation, name and remove a blank line
2017-06-08 12:22:48 +02:00
Mathieu Magnin
887512c26c
Procedure path can contain dashes and can be longer
2017-04-21 16:32:48 +02:00
Mathieu Magnin
080c7c3d04
Fix csv export with no dossiers
2017-04-12 18:19:37 +02:00
Mathieu Magnin
bf0d466f4b
Move export_full_generation method from Dossier to Procedure
2017-04-05 12:26:38 +02:00
Simon Lehericey
367f06495e
ProcedureSpec: remove useless tests
2017-03-13 14:13:21 +01:00
Mathieu Magnin
9cd506e265
Clone mail_templates with procedure
2017-03-07 18:19:48 +01:00
Simon Lehericey
02bbf0543f
Mails: move to their own namespace
2017-03-07 10:27:14 +01:00
Simon Lehericey
70b2020656
Procedure: remove mail_template
2017-03-07 10:27:13 +01:00
Simon Lehericey
206d56f106
Procedure: add the new mails
2017-03-07 10:27:13 +01:00
Simon Lehericey
7b336922cc
Cleaning
2017-03-07 10:25:34 +01:00
Simon Lehericey
c22c84f1f9
Procedure: add inititad_mail with default provider
2017-03-07 10:25:34 +01:00
Mathieu Magnin
8139f33db8
Fix test after deleting unused email template
2017-03-01 16:27:08 +01:00