Commit graph

26 commits

Author SHA1 Message Date
Martin
c90175f121 tech(api-entreprise.etablissement): passage du endpoint ETABLISSEMENT_RESOURCE_NAME en v3 2023-06-01 09:06:36 +02:00
Christophe Robillard
ba281d53cf migrate entreprise adapter to v3 2023-05-26 13:37:20 +02:00
Colin Darie
ae88c1de6b
fix(devise): default config for devise and turbo stream as navigational format 2023-05-03 11:35:32 +02:00
Colin Darie
954652fcf5
fix(champ): may fix pg deadlocks: autosave already saves value at the same time 2023-03-20 14:32:14 +01:00
sebastiencarceles
becf4da70a fix raison social fetch 2023-02-27 13:54:35 +01:00
sebastiencarceles
30eef3e128 review: detailled error message 2023-02-27 13:45:16 +01:00
Sébastien Carceles
df2eaa9542 don't clean the siret champ value
Cleaning the value is useless, when fetching the etablissement,
as the value will be re-written by the dossier update, when the user
fills in the dossier.
2023-02-27 13:45:16 +01:00
Paul Chavard
e6288c39f2 refactor(dossier): champs -> champs_public 2022-11-10 22:44:39 +00:00
simon lehericey
9d2d19800d feat(champ siret): save etablissement in degraded mode if api down and allow submission 2022-09-19 12:12:05 +02:00
Paul Chavard
2db892d876 refactor(turbo): champ siret and dossier_link use turbo 2022-05-04 14:11:43 +02:00
Paul Chavard
3384b535c5 refactor(champ): simplify siret champ 2022-05-03 16:14:54 +02:00
Pierre de La Morinerie
5908b8019a specs: properly use xhr: true in javascript requests
This avoids an unexpected `ActionController::InvalidCrossOriginRequest`
exception to be raised when the forgery protection is disabled.
2021-06-22 13:21:55 +02:00
Pierre de La Morinerie
150ddab660 zeitwerk: Api -> API 2021-02-09 13:07:30 +01:00
Judith
6d89a83d14 unused locales clean-up 2021-02-04 12:15:13 +01:00
kara Diaby
f748ccfc9e Appelle l'API entreprise avec le token en Header 2020-12-10 17:49:49 +01:00
Pierre de La Morinerie
6328011f60 models: require belong_to associations on champ
- Make `champ.dossier` a requirement;
- Move the dossier_id assignation to `before_validation` (otherwise
the record is invalid, and never gets saved);
- Allow specs to only build the champ (instead of saving it to the
database), which bypasses the requirement to have a dossier.
2020-08-18 15:57:37 +02:00
Christophe Robillard
fb87a09c02 doesn't update dossier etablissement for siret controller 2020-05-26 18:13:20 +02:00
Christophe Robillard
637bde7326 update siret_controller when finding etablissement
now, `ApiEntrepriseService` does'nt return a hash anymore but an
etablissement which is already persisted.
2020-05-20 11:09:54 +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
Paul Chavard
c281347da1 Remove restclient 2020-03-17 11:12:14 +01:00
Pierre de La Morinerie
e06e32238c api_entreprise: display a specific error message on network errors 2019-05-02 11:24:38 +02:00
Pierre de La Morinerie
7c1c61248e spec: cleanup siret_controller_spec.rb 2019-05-02 11:24:22 +02:00
simon lehericey
f945b9ec63 Champ Siret: Fix siret-champ save
When a user enter a siret, it calls siret_controller in ajax. The champ value is stil nil, so champ.present? is false because champ.blank is redefined to focus on value. Thus the champ is not updated.
2019-04-02 14:17:21 +02:00
Paul Chavard
69a51e3296 Save SIRET data on search 2019-03-19 16:22:42 +01:00
gregoirenovel
ed240cb4d3 Enable Style/UnneededInterpolation 2018-10-03 12:03:21 +02:00
Paul Chavard
55a9b31b93 Cleanup SIRET champ 2018-09-12 15:53:02 +02:00