From 745c9cd72bdc8b037f9b7b7fd9b3a11dcf869d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 29 Aug 2018 08:49:55 +0200 Subject: [PATCH] Don't check already present page content The content 'An example legislation process' is already present before we click the "All" link. Not checking the page content properly sometimes resulted in the second click being executed before the first request had been completed, making the spec fail. By checking the "All" link isn't present anymore, we guarantee the request has been completed before trying to click the 'An example legislation process' link. --- spec/features/admin/legislation/draft_versions_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/admin/legislation/draft_versions_spec.rb b/spec/features/admin/legislation/draft_versions_spec.rb index a17c2522e..8aac1d201 100644 --- a/spec/features/admin/legislation/draft_versions_spec.rb +++ b/spec/features/admin/legislation/draft_versions_spec.rb @@ -85,7 +85,7 @@ feature 'Admin legislation draft versions' do click_link "All" - expect(page).to have_content 'An example legislation process' + expect(page).not_to have_link "All" click_link 'An example legislation process' click_link 'Drafting'