Started adding update tests
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
806bc955f2
commit
5f0b735662
|
@ -140,8 +140,13 @@ func TestList(t *testing.T) {
|
|||
t.Run("Update", func(t *testing.T) {
|
||||
t.Run("Normal", func(t *testing.T) {
|
||||
// Check the list was loaded sucessfully afterwards, see testReadOne
|
||||
|
||||
rec, err := testHandler.testUpdate(nil, map[string]string{"list": "1"}, `{"title":"TestLoremIpsum"}`)
|
||||
assert.NoError(t, err)
|
||||
assert.Contains(t, rec.Body.String(), `"title":"TestLoremIpsum"`)
|
||||
})
|
||||
// TODO: empty title, min/maxlength of the title & description
|
||||
// Also test with only one parameter
|
||||
// Test chaning the owner
|
||||
t.Run("Nonexisting", func(t *testing.T) {
|
||||
|
||||
})
|
||||
|
|
|
@ -73,11 +73,6 @@ func CreateOrUpdateList(list *List) (err error) {
|
|||
// @Failure 500 {object} models.Message "Internal error"
|
||||
// @Router /lists/{id} [post]
|
||||
func (l *List) Update() (err error) {
|
||||
// Check if it exists
|
||||
lorig := List{ID: l.ID}
|
||||
if err = lorig.GetSimpleByID(); err != nil {
|
||||
return
|
||||
}
|
||||
return CreateOrUpdateList(l)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue