Merge pull request #743 from sgmap/when_filling_champ_ensure_it_is_a_text_champ

When filling a champ ensure it is a text champ
This commit is contained in:
Mathieu Magnin 2017-09-20 10:37:47 +02:00 committed by GitHub
commit a65b5f6fc3

View file

@ -39,7 +39,7 @@ feature 'As a User I want to edit a dossier I own' do
page.find_by_id('maj_infos').trigger('click') page.find_by_id('maj_infos').trigger('click')
expect(page).to have_current_path(users_dossier_description_path(dossier.id.to_s), only_path: true) expect(page).to have_current_path(users_dossier_description_path(dossier.id.to_s), only_path: true)
champ_id = dossier.champs.order(:id).first.id champ_id = dossier.champs.find { |t| t.type_champ == "text" }.id
fill_in "champs_#{champ_id.to_s}", with: 'Contenu du champ 1' fill_in "champs_#{champ_id.to_s}", with: 'Contenu du champ 1'
page.find_by_id('modification_terminee').click page.find_by_id('modification_terminee').click
expect(page).to have_current_path(users_dossier_recapitulatif_path(dossier.id.to_s), only_path: true) expect(page).to have_current_path(users_dossier_recapitulatif_path(dossier.id.to_s), only_path: true)