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:
@@ -160,7 +160,7 @@ describe "Voters" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Store officer and booth information" do
|
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?")
|
poll1 = create(:poll, name: "¿Quieres que XYZ sea aprobado?")
|
||||||
poll2 = create(:poll, name: "Pregunta de votación de prueba")
|
poll2 = create(:poll, name: "Pregunta de votación de prueba")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user