parent
6f14e7783f
commit
acc1cb1abd
2 changed files with 9 additions and 1 deletions
|
@ -43,7 +43,7 @@ class PiecesJustificativesService
|
|||
private
|
||||
|
||||
def self.pjs_for_champs(dossier)
|
||||
allowed_champs = dossier.champs
|
||||
allowed_champs = dossier.champs + dossier.champs_private
|
||||
|
||||
allowed_child_champs = allowed_champs
|
||||
.filter { |c| c.type_champ == TypeDeChamp.type_champs.fetch(:repetition) }
|
||||
|
|
|
@ -16,6 +16,14 @@ describe ActiveStorage::DownloadableFile do
|
|||
it { expect(list.length).to eq 1 }
|
||||
end
|
||||
|
||||
context 'when there is a private piece_justificative' do
|
||||
before do
|
||||
dossier.champs_private << create(:champ, :piece_justificative, :with_piece_justificative_file, private: true)
|
||||
end
|
||||
|
||||
it { expect(list.length).to eq 1 }
|
||||
end
|
||||
|
||||
context 'when there is a repetition bloc' do
|
||||
let(:champ) { build(:champ_repetition_with_piece_jointe) }
|
||||
let(:dossier) { create(:dossier, :en_construction, champs: [champ]) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue