Merge pull request #3762 from betagouv/dev

2019-04-08-01
This commit is contained in:
Nicolas Bouilleaud 2019-04-08 16:56:32 +02:00 committed by GitHub
commit 6acc412b79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 11 deletions

1
.gitignore vendored
View file

@ -26,6 +26,7 @@ storage/
yarn-debug.log*
.yarn-integrity
/.vscode
/.idea
/public/packs
/public/packs-test
/node_modules

View file

@ -30,7 +30,7 @@ Vous souhaitez y apporter des changements ou des améliorations ? Lisez notre [
- Chrome
- chromedriver :
* Mac : `brew install chromedriver`
* Mac : `brew cask install chromedriver`
* Linux : voir https://sites.google.com/a/chromium.org/chromedriver/downloads
### Création des rôles de la base de données

View file

@ -21,11 +21,13 @@ class GestionnaireMailer < ApplicationMailer
def last_week_overview(gestionnaire)
email = gestionnaire.email
@overview = gestionnaire.last_week_overview
headers['X-mailjet-campaign'] = 'last_week_overview'
@subject = 'Votre activité hebdomadaire'
@overview = gestionnaire.last_week_overview
mail(to: email, subject: @subject)
if @overview.present?
headers['X-mailjet-campaign'] = 'last_week_overview'
mail(to: email, subject: @subject)
end
end
def send_dossier(sender, dossier, recipient)

View file

@ -65,7 +65,7 @@
pour y accéder vous pouvez utiliser le lien :
= link_to procedure_lien(@procedure), sanitize_url(procedure_lien(@procedure)), target: :blank, rel: :noopener
%p
Tout personne ayant la connaissance de ce lien pourra ainsi remplir des dossiers de test sur votre démarche.
Toute personne ayant la connaissance de ce lien pourra ainsi remplir des dossiers de test sur votre démarche.
%br
%h4 Ce que vous pouvez faire lorsque vous êtes en test

View file

@ -1,5 +1,4 @@
~ form.text_area :value,
row: 6,
placeholder: champ.description,
required: champ.mandatory?,
value: html_to_string(champ.value)

View file

@ -35,5 +35,15 @@ RSpec.describe GestionnaireMailer, type: :mailer do
subject { described_class.last_week_overview(gestionnaire) }
it { expect(subject.body).to include('Votre activité hebdomadaire') }
context 'when the gestionnaire has no active procedures' do
let(:procedure) { nil }
let(:last_week_overview) { nil }
it 'doesnt send the email' do
expect(subject.message).to be_kind_of(ActionMailer::Base::NullMail)
expect(subject.body).to be_blank
end
end
end
end

View file

@ -754,13 +754,13 @@ describe Procedure do
let!(:old_dossier) { create_dossier(construction_date: 3.months.ago, instruction_date: 2.months.ago) }
it 'ignores dossiers older than 1 month' do
expect(procedure.usual_verification_time).to be_within(10.seconds).of(2.days)
expect(procedure.usual_verification_time).to be_within(1.hour).of(2.days)
end
end
context 'when there is only one dossier in the time frame' do
let(:delays) { [1.day] }
it { expect(procedure.usual_verification_time).to be_within(10.seconds).of(1.day) }
it { expect(procedure.usual_verification_time).to be_within(1.hour).of(1.day) }
end
context 'where there are no dossiers' do
@ -796,7 +796,7 @@ describe Procedure do
let!(:old_dossier) { create_dossier(instruction_date: 3.months.ago, processed_date: 2.months.ago) }
it 'ignores dossiers older than 1 month' do
expect(procedure.usual_instruction_time).to be_within(10.seconds).of(2.days)
expect(procedure.usual_instruction_time).to be_within(1.hour).of(2.days)
end
end
@ -805,13 +805,13 @@ describe Procedure do
let!(:bad_dossier) { create_dossier(instruction_date: nil, processed_date: 10.days.ago) }
it 'ignores bad dossiers' do
expect(procedure.usual_instruction_time).to be_within(10.seconds).of(2.days)
expect(procedure.usual_instruction_time).to be_within(1.hour).of(2.days)
end
end
context 'when there is only one processed dossier' do
let(:delays) { [1.day] }
it { expect(procedure.usual_instruction_time).to be_within(10.seconds).of(1.day) }
it { expect(procedure.usual_instruction_time).to be_within(1.hour).of(1.day) }
end
context 'where there is no processed dossier' do