Commit graph

214 commits

Author SHA1 Message Date
Pierre de La Morinerie
b466fa7878 spec: ensure checkbox is visible before clicking it
There's a random failure in this spec, where the CI triggers this error:

> Failure/Error: check('checkbox')
>     
>     Selenium::WebDriver::Error::ElementClickInterceptedError:
>       element click intercepted: Element <input required="required" type="checkbox" value="on" name="dossier[champs_attributes][7][value]" id="dossier_champs_attributes_7_value"> is not clickable at point (205, 892). Other element would receive the click: <div class="send-dossier-actions-bar">...</div>

That's because the checkbox is partially overlapped by the sticky
action bar at the bottom of the screen – but only _some of the time_.

This commit attempts to fix the issue by manually scrolling the checkbox
at the center of the screen before clicking it.
2021-10-01 00:33:57 +02:00
Pierre de La Morinerie
eef90efd49 app: fix exception during password reset when the token has expired 2021-09-21 10:30:09 -05:00
Pierre de La Morinerie
e5f449b595 devise: unify password reset views
By default, Devise will look for views:

1. First in `views/resource/passwords/…`,
2. Then in `views/devise/passwords/…` if not found.

By moving the views to `views/devise`, we avoid having a partial in
`views/shared` that we need to include manually, and instead let Devise
do the job automatically.
2021-09-09 09:40:40 -05:00
Pierre de La Morinerie
80f9d4adc0 devise: use password_strength component in SuperAdmin::PasswordsController 2021-09-09 09:40:39 -05:00
Pierre de La Morinerie
62e4f7ee32 devise: use password_complexity in User::PasswordsController
This fixes the password strength meter no longer being displayed when
an admin changes their password.
2021-09-09 09:40:39 -05:00
Paul Chavard
00c7c7c419 test(dossier): test dossier transfer 2021-09-08 15:49:04 +02:00
Paul Chavard
a3cc072bbd feat(i18n): translate countries selector 2021-08-31 13:15:26 +02:00
Pierre de La Morinerie
e1909ed29f brouillon: redirect to sign-in when disconnected
There are two cases where the draft auto-save might fail because the
user is no longer authenticated:

- The user signed-out in another tab,
- The brower quit and re-opened, so the Session cookie expired.

In both cases, the auto-save will never succeed until the user
authenticates again, so displaying a "Retry" button is cruel.

Moreover, in plus of all auto-save requests failing with a small error,
the actual hard failure only occurs after filling all the form and
trying to submit it. Then the user is redirected to the sign-in page –
but all their changes are lost.

Instead, we now redirect to the sign-in page on the first 401 error
during the auto-save, let the user sign-in, and then redirect back to
the form.
2021-07-22 11:58:02 +02:00
Paul Chavard
9b0dae4cc2 Fix apostrophes ‘ -> ’ 2021-05-26 18:05:14 +02:00
Paul Chavard
85b907807a Improuve ComboMultipleDropdownList style 2021-04-28 12:54:45 +02:00
Pierre de La Morinerie
d530b272a1 password: add specific page for reset instructions 2021-04-22 14:24:15 +02:00
Pierre de La Morinerie
6b14420ffa sign_in: improve "Forgot password?" appearance on mobile 2021-04-20 09:34:52 +02:00
Pierre de La Morinerie
0749d981ab password: make the "Reset password" button clearer 2021-04-20 09:34:52 +02:00
François Vantomme
a596df9a4a Test: use APPLICATION_NAME to deal nicely with custom configuration 2021-04-13 22:46:33 +02:00
Christophe Robillard
b8097e782a rend accessible la selection multiple usager
en remplaçant select2 par ComboMultipleDropdownList
2021-02-16 16:47:14 +01:00
Pierre de La Morinerie
150ddab660 zeitwerk: Api -> API 2021-02-09 13:07:30 +01:00
kara Diaby
f748ccfc9e Appelle l'API entreprise avec le token en Header 2020-12-10 17:49:49 +01:00
Christophe Robillard
23ae528c6b affiche Madame ou Monsieur
mais continue à enregistrer en base Mme ou M.
2020-12-08 21:30:54 +01:00
Christophe Robillard
2066e3db87 rend plus compréhensible la civilité 2020-12-08 18:31:38 +01:00
Christophe Robillard
12d1a5bece implement ComboPaysSearch 2020-12-08 13:09:08 +00:00
Paul Chavard
653270d02f Update specs 2020-10-08 15:26:15 +02:00
clemkeirua
eb46cc6425 piecejusticative file validation focus on size 2020-09-25 09:35:16 +00:00
clemkeirua
31d48c2879 validation is enableed only for 'new' procedures 2020-09-25 09:35:16 +00:00
clemkeirua
8711e8f911 reenable validator on piece_justificative 2020-09-25 09:35:16 +00:00
clemkeirua
482bfdb059 fix tests for autosave_brouillon 2020-09-21 08:46:01 +00:00
clemkeirua
f9c4e967d6 remove :autosave_dossier_draft 2020-09-21 08:46:01 +00:00
Paul Chavard
dee12a2b0b update features specs to use revisions 2020-09-02 11:26:26 +02:00
Judith
7eee9beed7 adapting the specs 2020-09-01 16:48:41 +02:00
Christophe Robillard
090a247ba9 validates phone champ server side 2020-08-20 15:33:03 +02:00
Judith
bfabd3b6a5 Specs adapted 2020-08-13 13:41:45 +00:00
clemkeirua
c91e231347 spec: replace reference to ds in password 2020-07-23 16:20:16 +02:00
clemkeirua
bc34905742 fix heading order by removing useless h4 2020-07-20 11:36:55 +02:00
clemkeirua
8a2aa13b74 remove pending tests 2020-07-15 09:27:23 +00:00
kara Diaby
ba6b89743c put pending testsz 2020-07-13 12:24:48 +02:00
Paul Chavard
97f91513c8 Store drop_down_list values as jsonb 2020-06-25 13:14:17 +02:00
clemkeirua
465449e684 fix unit tests 2020-06-24 12:18:56 +02:00
Christophe Robillard
013e78ce4e fix creating dossier feature sprec 2020-05-20 11:09:54 +02:00
Pierre de La Morinerie
93bb5283ff app: remove the feature flag for pieces justificatives auto-upload
The feature works as intended: we can remove the feature flag.
2020-05-14 17:39:07 +02:00
Christophe Robillard
dba77ec0b8 fix spec with not expired token
and use of `ApiEntrepriseToken#roles`
2020-05-06 10:57:45 +02:00
Christophe Robillard
158b4802ab store attestation sociale and display 2020-04-29 16:25:47 +02:00
Christophe Robillard
453adf3c74 instructeurs: affiche l'effectif moyen annuel n-1 2020-04-23 09:53:27 +02:00
Christophe Robillard
db3ef195ad fetch and show effectif mensuel
- fetch and store effectif mensuel (at the creation of the dossier or
when updating a siret field

- show effectif mensuel only for instructeurs
2020-04-21 14:22:11 +02:00
clemkeirua
46e14f4033 add test for users/list_dossiers_spec 2020-04-09 09:42:31 +02:00
clemkeirua
8ff3d9ea47 update existing tests 2020-04-09 09:42:31 +02:00
Pierre de La Morinerie
6417c0d2c0 dossiers: allow auto upload of attachments 2020-03-31 13:09:44 +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
Pierre de La Morinerie
f895570b00 dossier: make the upload label a real label 2020-03-25 14:43:09 +01:00
clemkeirua
a34b45e4f4 make the 'male' field selected by default during identity creation 2020-03-25 09:50:41 +00:00
clemkeirua
d49f6e703e fix tests for datetime 2020-03-24 16:54:35 +00:00
Christophe Robillard
884de51b94 Revert "Revert "go to procedure after cliking link""
This reverts commit 952bae32fe.
2020-03-20 10:41:36 +01:00