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.
This commit is contained in:
Javi Martín
2021-03-27 22:36:42 +01:00
parent 919d0b8b86
commit fbc78984dc

View File

@@ -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"