Skip to content

Commit 0df6963

Browse files
authored
Fix flaky distribution system specs (#4869)
We were saving a new distribution (which causes a redirect to that distribution's show page) and then immediately clicking on the distributions index page (which redirects as well). This introduced a race condition that was flaky when we tried to click a link that didn't exist on the page.
1 parent 3908561 commit 0df6963

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/system/distribution_system_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,9 +558,9 @@
558558

559559
context "when editing that distribution" do
560560
before do
561-
click_on "Distributions", match: :first
562-
click_on "Edit", match: :first
563561
@distribution = Distribution.last
562+
expect(page).to have_current_path(distribution_path(@distribution.id))
563+
click_on "Make a Correction"
564564
end
565565

566566
it "User creates a distribution from a donation then edits it" do

0 commit comments

Comments
 (0)