ajout d'un test automatisé

This commit is contained in:
clemkeirua 2019-11-20 15:54:53 +01:00
parent 9503a363e5
commit 789fcf72ca
2 changed files with 15 additions and 1 deletions

View file

@ -24,5 +24,19 @@ describe ActiveStorage::DownloadableFile do
expect(list.size).to eq(4)
end
end
context 'when there is a message with no attachment' do
let(:commentaire) { create(:commentaire) }
let(:dossier) { commentaire.dossier }
it { expect(list.length).to be 0 }
end
context 'when there is a message with an attachment' do
let(:commentaire) { create(:commentaire, :with_file) }
let(:dossier) { commentaire.dossier }
it { expect(list.length).to be 1 }
end
end
end