From 5f747122c5415708b91df60c06ee1f77e849f1e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 14 Jun 2021 17:10:20 +0200 Subject: [PATCH] Don't assign IDs to user records in tests This test will fail if the ID of the created record is the same as the ID of the first user we create in the test. The chance is very low due to the `rand(9999999)` which causes the test to fail just once every ten million times. However, why assigning the ID in the first place? Without it, the test will never fail due to conflicting IDs. --- spec/system/officing/voters_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/system/officing/voters_spec.rb b/spec/system/officing/voters_spec.rb index 433ec10a5..9ab626784 100644 --- a/spec/system/officing/voters_spec.rb +++ b/spec/system/officing/voters_spec.rb @@ -160,7 +160,7 @@ describe "Voters" do end scenario "Store officer and booth information" do - create(:user, :in_census, id: rand(9999999)) + create(:user, :in_census) poll1 = create(:poll, name: "¿Quieres que XYZ sea aprobado?") poll2 = create(:poll, name: "Pregunta de votación de prueba")