More robust testing
This commit is contained in:
@@ -8,6 +8,8 @@ import (
|
||||
"go-sjles-pta-vote/server/models"
|
||||
)
|
||||
|
||||
var ErrQuestionAlreadyExists = errors.New("Question already exists")
|
||||
|
||||
func CreatePoll(poll *models.Poll) (*models.Poll, error) {
|
||||
new_poll := models.Poll{}
|
||||
|
||||
@@ -33,7 +35,7 @@ func CreatePoll(poll *models.Poll) (*models.Poll, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return nil, errors.New("Already exists")
|
||||
return nil, ErrQuestionAlreadyExists
|
||||
}
|
||||
|
||||
stmt, err := db_conn.Prepare(`
|
||||
|
||||
Reference in New Issue
Block a user