From 543987adbdd454a8d4297a7cf2164f27039f3ffe Mon Sep 17 00:00:00 2001 From: Morgan Roderick Date: Fri, 16 Oct 2026 12:50:16 +0200 Subject: [PATCH] test: pin member search fixtures against Faker collisions The admin member search spec is flaky: the search matches name and email with ILIKE '%Julie%', and the fabricated members draw random Faker names and emails. A draw containing "julie" (about 0.09% per member) turns the single expected match into two, the controller then renders the pick list instead of redirecting, and the path assertion fails. This showed up once in CI on PR #3042 (Tests Group 0, 2026-10-16). Pinning the three fixtures makes the match deterministic. --- spec/features/admin/member_search_spec.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spec/features/admin/member_search_spec.rb b/spec/features/admin/member_search_spec.rb index 7d3e75492..c2819c434 100644 --- a/spec/features/admin/member_search_spec.rb +++ b/spec/features/admin/member_search_spec.rb @@ -1,10 +1,14 @@ require 'rails_helper' RSpec.feature 'admin member search' do + # Names and emails are pinned: the search matches name and email with ILIKE + # '%Julie%', and Faker draws a name or email containing "julie" about 0.09% + # of the time, which turns the single expected match into two and flakes the + # redirect assertion. scenario 'search returns single member to requesting service' do - Fabricate(:member, name: 'Romeo', surname: 'Montague') - Fabricate(:member, name: 'Juliet', surname: 'Capulet') - member = Fabricate(:member) + Fabricate(:member, name: 'Romeo', surname: 'Montague', email: 'romeo.montague@example.com') + Fabricate(:member, name: 'Juliet', surname: 'Capulet', email: 'juliet.capulet@example.com') + member = Fabricate(:member, name: 'Anne', surname: 'Archer', email: 'anne.archer@example.com') login_as_admin(member) visit admin_member_search_index_path(callback_url: results_admin_member_search_index_path)