2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-11-08 16:46:57 +01:00
|
|
|
describe Champs::TitreIdentiteChamp do
|
|
|
|
describe "#for_export" do
|
2024-07-01 15:31:32 +02:00
|
|
|
let(:champ) { described_class.new }
|
|
|
|
before { allow(champ).to receive(:type_de_champ).and_return(build(:type_de_champ_titre_identite)) }
|
2024-10-21 11:51:34 +02:00
|
|
|
subject { champ.type_de_champ.champ_value_for_export(champ) }
|
2022-11-08 16:46:57 +01:00
|
|
|
|
2024-07-01 15:31:32 +02:00
|
|
|
context 'without attached file' do
|
|
|
|
let(:piece_justificative_file) { double(attached?: true) }
|
|
|
|
before { allow(champ).to receive(:piece_justificative_file).and_return(piece_justificative_file) }
|
|
|
|
it { is_expected.to eq('présent') }
|
|
|
|
end
|
2022-11-08 16:46:57 +01:00
|
|
|
|
|
|
|
context 'without attached file' do
|
|
|
|
it { is_expected.to eq('absent') }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|