From fbc78984dcb70c2d2162dda0d7edd98bbfeb07ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 27 Mar 2021 22:36:42 +0100 Subject: [PATCH] Fill in the right field in phases test Before clicking the "Edit phase" link, there's already a "Name" field present in the page (the name of the budget). With the rack driver, there's no problem since the `fill_in` action waits until the page is loaded. However, the test will be a flaky spec if we use a driver supporting JavaScript, since clicking the "Edit phase" link will cause an AJAX request and the `fill_in` action might be executed before the AJAX request is finished. --- spec/system/admin/budget_phases_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/system/admin/budget_phases_spec.rb b/spec/system/admin/budget_phases_spec.rb index 19320e86b..4a25f89b2 100644 --- a/spec/system/admin/budget_phases_spec.rb +++ b/spec/system/admin/budget_phases_spec.rb @@ -32,6 +32,8 @@ describe "Admin budget phases" do within("tr", text: "Accepting projects") { click_link "Edit phase" } end + expect(page).to have_css "h2", exact_text: "Edit Participatory budget - Accepting projects" + fill_in "Name", with: "My phase custom name" click_button "Save changes"