From 1de4ef8a9af0e8a9ac8b8397dc51ef8cecf56b5f Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 21 Nov 2019 18:29:39 +0100 Subject: [PATCH] specs: fix error in routing feature test by waiting for Turbolinks --- spec/features/routing/full_scenario_spec.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/features/routing/full_scenario_spec.rb b/spec/features/routing/full_scenario_spec.rb index 9f6bc2f77..6e6172437 100644 --- a/spec/features/routing/full_scenario_spec.rb +++ b/spec/features/routing/full_scenario_spec.rb @@ -111,19 +111,20 @@ feature 'The routing', js: true do sign_in_with victor.user.email, password ## on the procedures list - expect(page).to have_css("span.notifications") + expect(page).to have_current_path(instructeur_procedures_path) + expect(find('.procedure-stats')).to have_css('span.notifications') ## on the dossiers list click_on procedure.libelle expect(page).to have_current_path(instructeur_procedure_path(procedure)) - expect(page).to have_css("span.notifications") + expect(find('.tabs')).to have_css('span.notifications') ## on the dossier itself click_on 'suivi' click_on litteraire_user.email expect(page).to have_current_path(instructeur_dossier_path(procedure, litteraire_user.dossiers.first)) - expect(page).to have_css("span.notifications") - + expect(page).to have_text('Annotations privées') # ensure Turbolinks DID load the DOM content + expect(find('.tabs')).to have_css('span.notifications') log_out # the scientifiques instructeurs should not have a notification