Gestionnaire Namespace: fix last_week_overview

This commit is contained in:
simon lehericey 2018-02-23 13:11:29 +01:00
parent 4189a2790d
commit 26c9f28407
2 changed files with 31 additions and 3 deletions

View file

@ -4,7 +4,7 @@
%h2{ style: 'font-size: 20px; font-weight: 300; margin: 25px 0 5px;' }
#{procedure_overview.procedure.libelle}
= link_to 'voir', procedure_url(procedure_overview.procedure), style: 'color: #4393F3; font-size: 14px;'
= link_to 'voir', gestionnaire_procedure_url(procedure_overview.procedure), style: 'color: #4393F3; font-size: 14px;'
%table{ cellpadding: '0', cellspacing: '0', style: 'width: 100%; padding-bottom: 20px;' }
%tbody
@ -24,7 +24,7 @@
- if procedure_overview.old_dossiers_en_construction.count < 6
\:
- old_dossiers_en_construction = procedure_overview.old_dossiers_en_construction.map do |old_dossier|
- link_to "nº #{old_dossier.id}", dossier_url(procedure_overview.procedure, old_dossier), style: 'color: #4393F3;'
- link_to "nº #{old_dossier.id}", gestionnaire_dossier_url(procedure_overview.procedure, old_dossier), style: 'color: #4393F3;'
- end.join(', ')
= sanitize(old_dossiers_en_construction, attributes: %w(href style))
@ -38,7 +38,7 @@
- if procedure_overview.old_dossiers_en_instruction.count < 6
\:
- old_dossiers_en_instruction = procedure_overview.old_dossiers_en_instruction.map do |old_dossier|
- link_to "nº #{old_dossier.id}", dossier_url(procedure_overview.procedure, old_dossier), style: 'color: #4393F3;'
- link_to "nº #{old_dossier.id}", gestionnaire_dossier_url(procedure_overview.procedure, old_dossier), style: 'color: #4393F3;'
- end.join(', ')
= sanitize(old_dossiers_en_instruction, attributes: %w(href style))

View file

@ -8,4 +8,32 @@ RSpec.describe GestionnaireMailer, type: :mailer do
it { expect(subject.body).to include('Bonjour') }
end
describe '#last_week_overview' do
let(:gestionnaire) { create(:gestionnaire) }
let(:procedure) { create(:procedure, :published, gestionnaires: [gestionnaire]) }
let(:dossier) { create(:dossier) }
let(:last_week_overview) do
procedure_overview = double('po',
procedure: procedure,
created_dossiers_count: 0,
dossiers_en_construction_count: 1,
old_dossiers_en_construction: [dossier],
dossiers_en_construction_description: 'desc',
dossiers_en_instruction_count: 1,
old_dossiers_en_instruction: [dossier],
dossiers_en_instruction_description: 'desc')
{
start_date: DateTime.now,
procedure_overviews: [procedure_overview]
}
end
before { allow(gestionnaire).to receive(:last_week_overview).and_return(last_week_overview) }
subject { described_class.last_week_overview(gestionnaire) }
it { expect(subject.body).to include('Vos activités') }
end
end