add trad if export failed
This commit is contained in:
parent
a9ab1daf3a
commit
53f9f3cbdb
5 changed files with 21 additions and 3 deletions
|
@ -35,5 +35,7 @@
|
|||
%p
|
||||
- if @has_last_export.pending?
|
||||
= t('instructeurs.procedures.last_export_pending')
|
||||
- else
|
||||
- if @has_last_export.generated?
|
||||
= t('instructeurs.procedures.last_export_available_html', file_format: @has_last_export.format, file_url: @has_last_export.file.url)
|
||||
- if @has_last_export.failed?
|
||||
= t('instructeurs.procedures.last_export_failed', file_format: @has_last_export.format)
|
||||
|
|
|
@ -15,5 +15,7 @@
|
|||
%p
|
||||
- if @has_last_export.pending?
|
||||
= t('instructeurs.procedures.last_export_pending')
|
||||
- else
|
||||
- if @has_last_export.generated?
|
||||
= t('instructeurs.procedures.last_export_available_html', file_format: @has_last_export.format, file_url: @has_last_export.file.url)
|
||||
- if @has_last_export.failed?
|
||||
= t('instructeurs.procedures.last_export_failed', file_format: @has_last_export.format)
|
||||
|
|
|
@ -4,6 +4,7 @@ en:
|
|||
export_available_html: The export in %{file_format} format is ready. You can <a href="%{file_url}">download it</a>
|
||||
export_pending_html: We generate this export. You can see all your exports visiting <a href="%{url}">the exports list</a>.
|
||||
last_export_available_html: Your last export in %{file_format} format is ready. You can <a href="%{file_url}">download it</a>
|
||||
last_export_failed: Your last export in %{file_format} failed.
|
||||
last_export_pending: Your last export is in process.
|
||||
exports:
|
||||
title: Exports list
|
||||
|
|
|
@ -4,6 +4,7 @@ fr:
|
|||
export_available_html: L’export au format %{file_format} est prêt. Vous pouvez le <a href="%{file_url}">télécharger</a>
|
||||
export_pending_html: Nous générons cet export. Vous pouvez retrouver tous vos exports sur <a href="%{url}">la liste des exports</a>.
|
||||
last_export_available_html: Votre dernier export au format %{file_format} est prêt. Vous pouvez le <a href="%{file_url}">télécharger</a>
|
||||
last_export_failed: Votre dernier export au format %{file_format} n'a pas fonctionné.
|
||||
last_export_pending: Votre dernier export est en cours de création.
|
||||
exports:
|
||||
title: Liste des exports
|
||||
|
|
|
@ -534,7 +534,19 @@ describe Instructeurs::ProceduresController, type: :controller do
|
|||
it { expect(response.body).to include("Votre dernier export au format csv est prêt") }
|
||||
end
|
||||
|
||||
context 'with generated export more than hour ago' do
|
||||
context 'with failed export ' do
|
||||
let(:statut) { 'tous' }
|
||||
let!(:export) { create(:export, :failed, groupe_instructeurs: [gi_2], updated_at: 1.minute.ago) }
|
||||
render_views
|
||||
before do
|
||||
subject
|
||||
end
|
||||
|
||||
it { expect(assigns(:has_last_export)).to eq(export) }
|
||||
it { expect(response.body).to include("Votre dernier export au format csv n'a pas fonctionné") }
|
||||
end
|
||||
|
||||
context 'with export more than hour ago' do
|
||||
let(:statut) { 'tous' }
|
||||
let!(:export) { create(:export, :generated, groupe_instructeurs: [gi_2], updated_at: 2.hours.ago) }
|
||||
before do
|
||||
|
|
Loading…
Reference in a new issue