demarches-normaliennes/spec/models/champs/titre_identite_champ_spec.rb
2024-08-22 09:26:48 +02:00

19 lines
635 B
Ruby

# frozen_string_literal: true
describe Champs::TitreIdentiteChamp do
describe "#for_export" do
let(:champ) { described_class.new }
before { allow(champ).to receive(:type_de_champ).and_return(build(:type_de_champ_titre_identite)) }
subject { champ.for_export }
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
context 'without attached file' do
it { is_expected.to eq('absent') }
end
end
end