specs: remove old pieces_justificative from specs and factories

This commit is contained in:
Pierre de La Morinerie 2019-07-25 13:57:00 +00:00
parent f69f325236
commit ffe081c1f2
8 changed files with 15 additions and 55 deletions

View file

@ -1,13 +1,7 @@
describe ActiveStorage::DownloadableFile do
let(:tpjs) { [tpj_not_mandatory] }
let!(:tpj_not_mandatory) do
TypeDePieceJustificative.create(libelle: 'not mandatory', mandatory: false)
end
let(:procedure) { Procedure.create(types_de_piece_justificative: tpjs) }
let(:dossier) { Dossier.create(procedure: procedure) }
let(:procedure) { Procedure.create(types_de_piece_justificative: tpjs) }
let(:dossier) { Dossier.create(procedure: procedure) }
let(:list) { ActiveStorage::DownloadableFile.create_list_from_dossier(dossier) }
let(:dossier) { create(:dossier) }
subject(:list) { ActiveStorage::DownloadableFile.create_list_from_dossier(dossier) }
describe 'create_list_from_dossier' do
context 'when no piece_justificative is present' do
@ -15,9 +9,8 @@ describe ActiveStorage::DownloadableFile do
end
context 'when there is a piece_justificative' do
let (:pj) { create(:champ, :piece_justificative, :with_piece_justificative_file) }
before do
dossier.champs = [pj]
dossier.champs << create(:champ, :piece_justificative, :with_piece_justificative_file)
end
it { expect(list.length).to be 1 }