Commit graph

2491 commits

Author SHA1 Message Date
Christophe Robillard
0f881f942b raise if trying to del a user who can't be deleted 2020-01-13 10:06:43 +01:00
Christophe Robillard
696a058280 delete adminis with procs managed by other admins 2020-01-13 10:06:43 +01:00
Christophe Robillard
a0b4d97d08 fix rubocop offenses 2020-01-13 10:06:43 +01:00
Christophe Robillard
9a62d3fe0c delete a user 2020-01-13 10:06:43 +01:00
Christophe Robillard
58ef36ff57 tells if a user can be deleted 2020-01-13 10:06:43 +01:00
Paul Chavard
c6326bfa77 Fix tests involving attachment urls 2020-01-08 14:46:18 +01:00
Pierre de La Morinerie
b3558c497d dossiers: make build_default_individual explicit
It avoid the use of callbacks, and may avoid situations where an empty
individual is implicitely created.
2020-01-08 10:48:22 +01:00
Pierre de La Morinerie
5e05556ee8 dossiers: add a validation on dossier individual
Validate that a dossier on a `for_individual?` procedure always has
an `individual` associated record.

For this, the individual needs to be built before the record is
validated (i.e. even before the `before_create` callback is run).

This should help with #4596: now if a dossier is created without an
`individual`, or if the `invividual` record is later removed, the
validation will fail.
2020-01-08 10:48:22 +01:00
Pierre de La Morinerie
7f5b0d8bf3 specs: don't create an implicit brouillon in all test cases 2020-01-07 17:59:11 +01:00
Pierre de La Morinerie
630c6de967 specs: move the query for individual to the individual context 2020-01-07 17:59:11 +01:00
Paul Chavard
e61e39d345 Remove unused code and tests 2020-01-07 11:52:51 +01:00
Paul Chavard
ff46ee366e Fix user brouillon spec 2020-01-07 11:52:51 +01:00
Paul Chavard
4bbd16576b Add champ communes 2020-01-07 11:52:51 +01:00
Pierre de La Morinerie
8eb295d67e dossiers: avoid exceptions on invalid AASM transitions
When attempting an invalid transition on a dossier, provide a meaningful
error message (instead of letting an `AASM::InvalidTransition` exception
propagate).

This handles not only the case where the same state is applied twice
(which was already handled manually), but all cases where the transition
is invalid.
2019-12-19 13:25:32 +01:00
Pierre de La Morinerie
c7a307553c helpers: allow dossier_display_state to take a state as input
This allow to use either:

- `dossier_display_state(dossier)`
- `dossier_display_state(:en_construction)`
2019-12-19 13:22:40 +01:00
simon lehericey
60538c9c28 Controller use new export model 2019-12-18 13:13:15 +01:00
simon lehericey
745086cbb5 Simplify view 2019-12-18 13:13:15 +01:00
simon lehericey
d0939ae1a4 Add Export Model 2019-12-18 13:13:15 +01:00
simon lehericey
d0f0533a32 Remove unused code 2019-12-18 13:13:15 +01:00
simon lehericey
c02e8b9553 Routing: send emails to the right group 2019-12-16 17:47:08 +01:00
maatinito
a02a5edce3 Bug with time zone when testing sending of brouillon expiration notices 2019-12-11 17:34:10 +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
simon lehericey
058442c84e [link to #4557] An instructeur cannot change its email on its own 2019-12-11 17:18:21 +01:00
simon lehericey
e06733d01b Clean spec 2019-12-11 17:18:21 +01:00
Paul Chavard
6b5793f0b9 [GraphQL] fix a crash in mutations with an attachment 2019-12-11 13:22:32 +01:00
Paul Chavard
422b7f37ec [GraphQL] expose file information 2019-12-11 12:34:49 +01:00
Pierre de La Morinerie
c2882b6cc3 app: hide IE11 deprecation banner during the strike
Having two banners appearing in a few days may be overwhelming for
users.
2019-12-04 17:32:04 +01:00
Paul Chavard
2f060fc30a Add depubliee state to procedures 2019-12-04 16:52:41 +01:00
Paul Chavard
b5eafdab56 [GraphQL]: informations du service 2019-12-04 14:21:40 +01:00
Paul Chavard
fd42fafcb4 [GraphQL]: informations du demandeur du dossier 2019-12-04 12:39:29 +01:00
Christophe Robillard
4e7c779116 refuse les numéros de tel invalides
rend facultatif les numéros de téléphone
2019-12-04 05:34:43 +01:00
simon lehericey
006e426a11 Work on deletion mail 2019-12-03 17:18:53 +01:00
simon lehericey
79bfb8b143 Delete expired dossiers 2019-12-03 17:18:53 +01:00
simon lehericey
6391f7ff9c Work on notify_near_deletion mailer 2019-12-03 17:18:53 +01:00
simon lehericey
03b7e81ca4 Send deletion notice for near expired brouillon 2019-12-03 17:18:53 +01:00
Pierre de La Morinerie
3212dfddca app: allow hiding the browser banner for one week 2019-12-03 16:09:18 +01:00
Pierre de La Morinerie
fb3f82074d Hide the suggestions when the user corrects the address 2019-12-03 14:06:11 +01:00
Pierre de La Morinerie
1d1260060e Fix the tests by using event delegation 2019-12-03 14:06:11 +01:00
clemkeirua
849008231c ajout de test capybara 2019-12-03 14:06:11 +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
e7dd9e36d6 specs: fix Capybara warning
Capybara logs several warnings during tests:

> Locator Integer:243 for selector :link must be an instance of String
> or Symbol. This will raise an error in a future version of Capybara.

This is because we use selectors like `have_link(dossier.id)`, where the
locator is a Number (instead of a String or Symbol).
2019-11-28 12:09:12 +01:00
simon lehericey
6657459f9c Fix add instructeur with empty mail
As select2 does not handle required attribute, we can only add server side logic
2019-11-27 14:39:16 +01:00
Paul Chavard
e9f993fe0c [GraphQL]: normalize date names in French 2019-11-27 12:23:00 +01:00
Pierre de La Morinerie
a328e8d94a features: refactor the editor specs
- Add an `add_champ` helper
- Stop relying on a default champ being created
- Wait for all champs to be created by watching the "Add champ" button 

This should fix the flakiness of these tests.

Refs #4417
2019-11-27 11:58:46 +01:00
Pierre de La Morinerie
d0cd875e91 features: add a leave_browser_open helper 2019-11-27 11:58:45 +01:00
Pierre de La Morinerie
0ef4a5253c features: move feature matchers to their own file
This allows to have the same syntax than native Capybara matchers.
2019-11-27 11:58:45 +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
maatinito
14bc2b99b9 auto-archive badly occurs in UTC time and not in local time (1 hour too late in France, 10 hours before in Tahiti ;-) 2019-11-25 14:39:42 +01:00
clemkeirua
789fcf72ca ajout d'un test automatisé 2019-11-25 10:37:10 +01:00