Mise à jour des tests

This commit is contained in:
Kara Diaby 2024-10-03 14:40:41 +02:00
parent 1c651b4c93
commit 953ccbcfb6
No known key found for this signature in database
GPG key ID: C4D1B0CF9F24D759
2 changed files with 27 additions and 26 deletions

View file

@ -58,23 +58,16 @@ describe 'Administrateurs can edit procedures', js: true do
end
context 'when we associate tags' do
scenario 'the administrator can edit and persist the tags' do
procedure.update!(tags: ['social'])
let!(:social_tag) { ProcedureTag.create(name: 'social') }
let!(:planete_tag) { ProcedureTag.create(name: 'planete') }
scenario 'the tags are persisted when not interacting with the tags combobox' do
procedure.procedure_tags << social_tag
visit edit_admin_procedure_path(procedure)
select_combobox('procedure_tags_combo', 'planete', custom_value: true)
click_on 'Enregistrer'
expect(procedure.reload.tags).to eq(['social', 'planete'])
end
scenario 'the tags are persisted when non interacting with the tags combobox' do
procedure.update!(tags: ['social'])
visit edit_admin_procedure_path(procedure)
click_on 'Enregistrer'
expect(procedure.reload.tags).to eq(['social'])
expect(procedure.procedure_tags.pluck(:name)).to match_array(['social'])
end
end