demarches-normaliennes/spec/support
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
..
active_job.rb specs: clear jobs queue before each test 2021-03-16 11:49:14 +01:00
capybara.rb chore(capybara): increase waiting time as workers are slow 2022-11-03 15:26:48 +01:00
controller_helpers.rb Files should not start with a new line 2017-04-04 16:59:38 +02:00
download_helpers.rb ajout d'un test sur le telechargement de zips 2020-07-21 15:45:57 +02:00
factory_bot.rb spec: better split spec_helper and rails_helper 2021-03-04 22:59:39 +01:00
feature_matchers.rb features: move feature matchers to their own file 2019-11-27 11:58:45 +01:00
public_api_matchers.rb feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
shared_examples_for_jobs.rb jobs: extract an RetryOnTranscientErrors concern 2021-04-29 14:08:12 +02:00
shared_examples_for_prefilled_dossier.rb feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
shared_exemples_for_dossier.rb specs: always require rails_helper 2020-03-31 12:48:32 +02:00
system_helpers.rb clean(js): remove unused autosave:reset 2022-10-25 14:44:43 +02:00
vcr.rb spec: better split spec_helper and rails_helper 2021-03-04 22:59:39 +01:00
warden.rb spec: better split spec_helper and rails_helper 2021-03-04 22:59:39 +01:00
webmock.rb test: fix frequent too many open files with webmock & capybara 2022-08-03 16:15:39 +02:00