Skip to content

Commit

Permalink
Fill in the right field in phases test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
javierm committed Apr 7, 2021
1 parent 919d0b8 commit fbc7898
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/system/admin/budget_phases_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
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"

Expand Down

0 comments on commit fbc7898

Please sign in to comment.