diff --git a/cmd/web/handlers_test.go b/cmd/web/handlers_test.go index 0ad6222..b830846 100644 --- a/cmd/web/handlers_test.go +++ b/cmd/web/handlers_test.go @@ -555,8 +555,7 @@ func TestCreateVotes_AlreadyVoted(t *testing.T) { On("Exists", mock.Anything, mock.Anything). Return(true, nil) - existingElectionPath := "/election/1/votes" - nonExistingElectionPath := "/election/1/votes" + path := "/election/1/votes" voterIdentity := "anything" tests := []struct { @@ -567,7 +566,7 @@ func TestCreateVotes_AlreadyVoted(t *testing.T) { }{ { name: "Invalid request for known voters election (already voted)", - urlPath: existingElectionPath, + urlPath: path, body: api.CreateVotesRequest{ Choices: []struct { ChoiceText string `json:"choiceText"` @@ -582,7 +581,7 @@ func TestCreateVotes_AlreadyVoted(t *testing.T) { }, { name: "Invalid request for unknown voters election (already voted)", - urlPath: nonExistingElectionPath, + urlPath: path, body: api.CreateVotesRequest{ Choices: []struct { ChoiceText string `json:"choiceText"`