From a93fd40e7a7037aaa2df90e9db4c8d87277c74d5 Mon Sep 17 00:00:00 2001 From: Cory Streiff <90390502+coalest@users.noreply.github.com> Date: Mon, 2 Dec 2024 02:44:10 +0100 Subject: [PATCH] Fix flaky distributions by county spec (#4816) --- .../distributions_by_county_system_spec.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/spec/system/distributions_by_county_system_spec.rb b/spec/system/distributions_by_county_system_spec.rb index e0cc2188cf..82006de4a3 100644 --- a/spec/system/distributions_by_county_system_spec.rb +++ b/spec/system/distributions_by_county_system_spec.rb @@ -18,8 +18,9 @@ partner_1.profile.served_areas.each do |served_area| expect(page).to have_text(served_area.county.name) end - expect(page).to have_text("50", count: 4) - expect(page).to have_text("$525.00", count: 4) + + expect(page).to have_css("table tbody tr td", text: "50", exact_text: true, count: 4) + expect(page).to have_css("table tbody tr td", text: "$525.00", exact_text: true, count: 4) end it("works for this year") do @@ -31,8 +32,9 @@ partner_1.profile.served_areas.each do |served_area| expect(page).to have_text(served_area.county.name) end - expect(page).to have_text("25", count: 4) - expect(page).to have_text("$262.50", count: 4) + + expect(page).to have_css("table tbody tr td", text: "25", exact_text: true, count: 4) + expect(page).to have_css("table tbody tr td", text: "$262.50", exact_text: true, count: 4) end it("works for prior year") do @@ -53,8 +55,8 @@ partner_1.profile.served_areas.each do |served_area| expect(page).to have_text(served_area.county.name) end - expect(page).to have_text("25", count: 4) - expect(page).to have_text("$262.50", count: 4) + expect(page).to have_css("table tbody tr td", text: "25", exact_text: true, count: 4) + expect(page).to have_css("table tbody tr td", text: "$262.50", exact_text: true, count: 4) end it("works for last 12 months") do @@ -75,8 +77,8 @@ partner_1.profile.served_areas.each do |served_area| expect(page).to have_text(served_area.county.name) end - expect(page).to have_text("25", count: 4) - expect(page).to have_text("$262.50", count: 4) + expect(page).to have_css("table tbody tr td", text: "25", exact_text: true, count: 4) + expect(page).to have_css("table tbody tr td", text: "$262.50", exact_text: true, count: 4) end end