Commit graph

42 commits

Author SHA1 Message Date
Martin
6a2d2ae0a7 bug(instructeurs/avis_controller#remind): ETQ instructeur, je peux relancer une demande d'avis meme si celui ci contient une question 2023-04-26 07:46:21 +02:00
Eric Leroy-Terquem
b306dea5cf refactor(avis): rename revive by remind 2023-02-01 09:55:46 +01:00
Eric Leroy-Terquem
004bf5be38 feat(avis): add remind_by! method 2023-02-01 09:55:46 +01:00
Paul Chavard
0b22788d60 experts_procedure should not be optional 2021-03-23 13:46:33 +01:00
kara Diaby
81f5a5254b tests 2021-03-18 11:38:52 +01:00
Pierre de La Morinerie
75a1046315 active_storage: refactor concerns
Follow-up of #5953.

Refactor the concerns with two goals:

- Getting closer from the way ActiveStorage adds its own hooks.
  Usually ActiveStorage does this using an `Attachment#after_create`
  hook, which then delegates to the blob to enqueue the job.
- Enqueuing each job only once. By hooking on `Attachment#after_create`,
  we guarantee each job will be added only once.

We then let the jobs themselves check if they are relevant or not, and
retry or discard themselves if necessary.

We also need to update the tests a bit, because Rails'
`perform_enqueued_jobs(&block)` test helper doesn't honor the `retry_on`
clause of jobs. Instead it forwards the exception to the caller – which
makes the test fail.

Instead we use the inline version of `perform_enqueued_jobs()`, without
a block, which properly ignores errors catched by retry_on.
2021-03-16 11:49:14 +01:00
Kara Diaby
0bd48999bd
Revert "feat/5635 - Supprime la possibilité pour l'expert invité d'envoyer un message" 2020-10-12 09:24:34 +02:00
kara Diaby
6636b7f14c Supprime la possibilité pour l'expert invité d'envoyer un message à l'usager 2020-10-08 11:14:09 +02:00
kara Diaby
9207cc5aa5 Ajoute un flag pour qu'un expert ne puisse pas inviter une autre personne à donner son avis sur un dossier 2020-10-02 18:57:29 +02:00
Christophe Robillard
b940d2e1b0 update dossier after saving avis
update last_avis_updated_at without hook

Co-authored-by: clemkeirua <clement@keiruaprod.fr>
2020-07-30 10:18:44 +02:00
clemkeirua
f3a675c3bc update dossier after saving commentaire
update last_commentaire_updated_at without hook

Co-authored-by: Christophe Robillard <christophe.robillard@beta.gouv.fr>
2020-07-30 10:18:44 +02:00
clemkeirua
c91e231347 spec: replace reference to ds in password 2020-07-23 16:20:16 +02:00
Christophe Robillard
169b8c9b3e explicite revive meaning 2020-07-21 10:51:53 +02:00
Christophe Robillard
d9cb5c067f relance un expert 2020-07-20 16:26:16 +02:00
Christophe Robillard
52e8f32e19 expert can only revoke avis claimed by him/her 2020-07-16 21:07:20 +02:00
Christophe Robillard
3ea34834a7 revoke expert avis 2020-07-16 21:05:11 +02:00
Pierre de La Morinerie
43569f687e specs: use fixture_file_upload rather than Rack::Test::UploadedFile
This is mostly for consistency (both styles were used before).

Note: we still have to use `Rack::Test::UploadedFile.new` in factories,
because of https://github.com/thoughtbot/factory_bot/issues/385.
2020-07-01 11:13:45 +02:00
Christophe Robillard
1d86f863d3 rename avis#all to avis#index 2020-06-30 09:17:27 +02:00
Christophe Robillard
bbec76d33b rename avis#index to avis#procedure 2020-06-30 09:17:27 +02:00
Christophe Robillard
63dd71aed4 display all avis for an expert 2020-06-30 09:17:27 +02:00
Christophe Robillard
29e2d3d7eb display all avis for a procedure for an expert 2020-06-30 09:17:27 +02:00
Christophe Robillard
c565c9c87b refactor sign_up_instructeur_avis_url 2020-06-30 09:17:27 +02:00
Christophe Robillard
4839506374 refactor instructeur_avis_url 2020-06-30 09:17:27 +02:00
Christophe Robillard
b0cfb2c02a refactor messagerie_instructeur_avis_url 2020-06-30 09:17:27 +02:00
Christophe Robillard
83fba55b29 refactor instruction_instructeur_avis_url 2020-06-30 09:17:27 +02:00
Christophe Robillard
72d27ffdb2 replace instructeur_avis_index url by instructeur_all_avis url 2020-06-30 09:17:27 +02:00
Christophe Robillard
dcb9afaf25 refactor expert avis url : fix avis_controller_spec 2020-06-30 09:17:27 +02:00
Christophe Robillard
3e1afa8bf9 fix avis spec 2020-06-30 09:17:27 +02:00
Christophe Robillard
aab4bb81ee return bilan bdf csv for expert 2020-05-11 13:05:50 +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
kara Diaby
b32ed88f9b add attachment when instructor asking for a review 2020-03-04 13:35:29 +00:00
Paul Chavard
7afeae1408 remove dossier.linked_dossiers 2020-02-11 17:49:22 +01:00
Pierre de La Morinerie
5d0a8b567f specs: improve description of Avis creation test cases 2020-02-11 17:38:58 +01:00
Paul Chavard
f0ea96772d Only invite experts to dossiers instructeur have access to 2020-02-11 17:38:57 +01:00
Pierre de La Morinerie
d78d206544 instructeurs: fix expert creation not to use Instructeur.email
It kind of worked until now, because the email field is disabled, and
thus never accessed.

But better make it clean, by accessing an object (User) where the email
field actually exists.
2019-11-04 10:44:24 +01:00
Pierre de La Morinerie
cd478b489e instructeurs: replace calls to Instructeur.find_by(email: …) 2019-11-04 10:44:23 +01:00
Paul Chavard
86b271997b Invite experts to linked dossiers
closes #3669
2019-10-23 13:10:09 +02:00
simon lehericey
8fa3c9e4f7 Fix expert invitation 2019-08-13 15:15:16 +02:00
simon lehericey
ad31822a68 Spec: sign_in with instructeur.user 2019-08-13 15:15:16 +02:00
simon lehericey
a4b9eecded Remove unused devise session controller 2019-08-13 14:13:48 +02:00
simon lehericey
3fde2a6f70 Rename gestionnaire in code to instructeur 2019-08-12 13:47:01 +02:00
simon lehericey
6902f84b85 Brutally rename gestionnaire filename to instructeur 2019-08-12 13:47:01 +02:00
Renamed from spec/controllers/gestionnaires/avis_controller_spec.rb (Browse further)