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.
This commit is contained in:
Javi Martín
2021-06-14 17:10:20 +02:00
parent 433b465ec7
commit 5f747122c5

View File

@@ -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")