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