2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-06-01 17:04:09 +02:00
|
|
|
RSpec.describe ConservationDeDonneesHelper, type: :helper do
|
2021-11-11 10:58:13 +01:00
|
|
|
let(:procedure) { build(:procedure, duree_conservation_dossiers_dans_ds: dans_ds) }
|
2018-06-01 17:04:09 +02:00
|
|
|
|
|
|
|
describe "politiques_conservation_de_donnees" do
|
2024-03-21 09:52:49 +01:00
|
|
|
let(:app_name) { "une superbe application" }
|
|
|
|
|
|
|
|
before { Current.application_name = app_name }
|
|
|
|
|
2018-06-01 17:04:09 +02:00
|
|
|
subject { politiques_conservation_de_donnees(procedure) }
|
|
|
|
|
2021-11-11 10:58:13 +01:00
|
|
|
context "when retention time is set" do
|
2018-06-01 17:04:09 +02:00
|
|
|
let(:dans_ds) { 3 }
|
|
|
|
let(:hors_ds) { 6 }
|
|
|
|
|
2024-03-21 09:52:49 +01:00
|
|
|
it { is_expected.to eq(["#{app_name} : 3 mois"]) }
|
2018-06-01 17:04:09 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
context "when the retention time is not set" do
|
|
|
|
let(:dans_ds) { nil }
|
|
|
|
let(:hors_ds) { nil }
|
|
|
|
|
|
|
|
it { is_expected.to be_empty }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|