demarches-normaliennes/spec/controllers
Sébastien Carceles 20136b7ac8
feat(demarche): create and prefill a dossier with POST request (#8233)
* add base controller for public api

* add dossiers controller with basic checks

* create the dossier

* ensure content-type is json

* prefill dossier with given values

* mark a dossier as prefilled

When a dossier is prefilled, it's allowed not to have a user.

Plus, we add a secure token to the dossier, which we will need later to set a
user after sign in / sign up.

* set user as owner of an orphan prefilled dossier

When a visitor comes from the dossier_url answered by the public api,
the dossier is orphan:
- when the user is already authenticated: they become the owner
- when the user is not authenticated: they can sign in / sign up / france_connect
and then they become the owner

So here is the procedure:
- allow to sign in / sign up / france connect when user is unauthenticated
- set dossier ownership when the dossier is orphan
- check dossier ownership when the dossier is not
- redirect to brouillon path when user is signed in and owner

* mark the dossier as prefilled when it's prefilled
(even with a GET request, because it will be useful later on, for
exmample in order to cleanup the unused prefilled dossiers)

* system spec: prefilling dossier with post request
2023-01-03 14:46:10 +01:00
..
administrateurs fix(dossier): update spec 2022-12-21 14:03:02 +01:00
agent_connect remove env dependence in spec 2022-04-11 14:40:02 +02:00
api feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
application_controller app: use a long-lived cookie for CSRF token 2021-07-20 11:11:52 +02:00
champs feat(piece_justificative): allow user to replace a PJ for dossier en_construction 2022-12-14 09:58:15 +01:00
concerns feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
devise specs: always require rails_helper 2020-03-31 12:48:32 +02:00
experts clean(flipper): remove unused expert_not_allowed_to_invite 2022-12-05 12:22:29 +01:00
france_connect refactor(ujs): france_connect controller to use turbo 2022-09-29 16:51:54 +02:00
instructeurs add bulk action feature for 'passer_en_instruction' 2022-12-15 10:04:25 +01:00
manager update wording and order in types de champ select 2022-12-16 09:30:36 +01:00
users feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
api_controller_spec.rb feat(api_token): api v1 use new token 2022-12-07 18:19:37 +01:00
application_controller_spec.rb feat(graphql): new tokens should carry administrateur_id 2022-09-29 11:58:58 +02:00
attachments_controller_spec.rb chore(piece_justificative): continue attachments refactor 2022-12-05 10:47:10 +01:00
invites_controller_spec.rb fix(invite): do not render menu when invite not found 2022-11-24 09:43:19 +01:00
password_complexity_controller_spec.rb refactor(turbo): password complexity check use turbo 2022-05-04 14:11:43 +02:00
ping_controller_spec.rb Fix ping controller in dev 2022-01-05 11:44:32 +01:00
prefillings_controller_spec.rb feat(prefill): add possible values (#8299) 2022-12-20 11:04:42 +01:00
recherche_controller_spec.rb simplify and improve perf by making the feature works only for id search 2022-11-15 10:51:36 +01:00
root_controller_spec.rb refacto: rename administration to super_admin 2020-11-05 16:03:55 +01:00
saml_idp_controller_spec.rb update saml controller and views 2022-08-23 15:05:20 +02:00
stats_controller_spec.rb fix(spec): avoid flacky test. 15.days ago is not always on the previous month. eg: this spec failed on 16 of december, stats is still in december 2021-12-16 15:02:17 +01:00
support_controller_spec.rb test(support): add contact-admin spec 2022-09-05 17:41:17 +02:00
targeted_user_links_controller_spec.rb fix(typography): fix quotes 2022-12-01 17:59:11 +01:00
webhook_controller_spec.rb evolution(helpscout.webhooks): mise en place des rappel web afin de notifier l'equipe tech des bug identifies par le support 2022-11-08 17:00:03 +01:00