replace filter+first with find

This commit is contained in:
clemkeirua 2020-09-24 15:09:41 +02:00 committed by Keirua (Rebase PR Action)
parent dfd2c1ee79
commit f3e487bd9e
3 changed files with 8 additions and 16 deletions

View file

@ -151,13 +151,11 @@ describe AttestationTemplate, type: :model do
context 'and their value in the dossier are not nil' do
before do
dossier.champs
.filter { |champ| champ.libelle == 'libelleA' }
.first
.find { |champ| champ.libelle == 'libelleA' }
.update(value: 'libelle1')
dossier.champs
.filter { |champ| champ.libelle == 'libelleB' }
.first
.find { |champ| champ.libelle == 'libelleB' }
.update(value: 'libelle2')
end