From 8f932b316673a36688b7f58b5439f429dfade5f9 Mon Sep 17 00:00:00 2001 From: Richard Lynch Date: Wed, 25 Sep 2024 11:57:06 +0100 Subject: [PATCH] Fix flakey test Sometimes "FE" ends up in the claim reference and so is visible in the tabble more than twice. To fix this we need to specifically look in the policy short names column. --- spec/features/admin/admin_claims_filtering_spec.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/features/admin/admin_claims_filtering_spec.rb b/spec/features/admin/admin_claims_filtering_spec.rb index 888a2ab4a4..b8a6cef57b 100644 --- a/spec/features/admin/admin_claims_filtering_spec.rb +++ b/spec/features/admin/admin_claims_filtering_spec.rb @@ -49,10 +49,12 @@ click_on "View claims" - expect(page.find("table")).to have_content("ECP").exactly(10).times - expect(page.find("table")).to have_content("TSLR").exactly(7).times - expect(page.find("table")).to have_content("STRI").exactly(2).times - expect(page.find("table")).to have_content("FE").exactly(2).times + policy_names = page.all("table tr td:nth-of-type(3)").map(&:text) + + expect(policy_names).to include("ECP").exactly(10).times + expect(policy_names).to include("TSLR").exactly(7).times + expect(policy_names).to include("STRI").exactly(2).times + expect(policy_names).to include("FE").exactly(2).times click_on "View claims" select "Student Loans", from: "policy"