diff --git a/app/rest/api/admin_test.go b/app/rest/api/admin_test.go index ac591035..7f39cbc0 100644 --- a/app/rest/api/admin_test.go +++ b/app/rest/api/admin_test.go @@ -41,7 +41,7 @@ func TestAdmin_Delete(t *testing.T) { cr := store.Comment{} err = json.Unmarshal([]byte(body), &cr) assert.Nil(t, err) - assert.Equal(t, "this comment was deleted", cr.Text) + assert.Equal(t, "", cr.Text) assert.True(t, cr.Deleted) } @@ -131,7 +131,8 @@ func TestAdmin_Block(t *testing.T) { err = json.Unmarshal([]byte(res), &comments) assert.Nil(t, err) assert.Equal(t, 2, len(comments), "should have 2 comments") - assert.Equal(t, "this comment was deleted", comments[0].Text) + assert.Equal(t, "", comments[0].Text) + assert.True(t, comments[0].Deleted) code, body = block(-1) require.Equal(t, 200, code) diff --git a/app/store/bolt_test.go b/app/store/bolt_test.go index 5e5f9dfe..b94057c2 100644 --- a/app/store/bolt_test.go +++ b/app/store/bolt_test.go @@ -41,7 +41,7 @@ func TestBoltDB_Delete(t *testing.T) { res, err = b.Find(loc, "time") assert.Nil(t, err) assert.Equal(t, 2, len(res)) - assert.Equal(t, "this comment was deleted", res[0].Text) + assert.Equal(t, "", res[0].Text) assert.True(t, res[0].Deleted, "marked deleted") assert.Equal(t, "some text2", res[1].Text) assert.False(t, res[1].Deleted) diff --git a/app/store/comment.go b/app/store/comment.go index 1c030229..965e8a9c 100644 --- a/app/store/comment.go +++ b/app/store/comment.go @@ -86,7 +86,7 @@ func (c *Comment) Sanitize() { // SetDeleted clears comment info, reset to deleted state func (c *Comment) SetDeleted() { - c.Text = "this comment was deleted" + c.Text = "" c.Score = 0 c.Votes = map[string]bool{} c.Edit = nil