diff --git a/app/rest/api/rest_test.go b/app/rest/api/rest_test.go index 0c1e2064..62cdee3d 100644 --- a/app/rest/api/rest_test.go +++ b/app/rest/api/rest_test.go @@ -67,7 +67,7 @@ func TestServer_Preview(t *testing.T) { assert.Equal(t, http.StatusOK, resp.StatusCode) b, err := ioutil.ReadAll(resp.Body) assert.Nil(t, err) - assert.Equal(t, "

test 123

", string(b)) + assert.Equal(t, "

test 123

\n", string(b)) } func TestServer_PreviewWithMD(t *testing.T) { @@ -121,7 +121,7 @@ func TestServer_CreateAndGet(t *testing.T) { comment := store.Comment{} err = json.Unmarshal([]byte(res), &comment) assert.Nil(t, err) - assert.Equal(t, "

test 123 http://radio-t.com

", comment.Text) + assert.Equal(t, "

test 123 http://radio-t.com

\n", comment.Text) assert.Equal(t, store.User{Name: "developer one", ID: "dev", Picture: "/api/v1/avatar/remark.image", Admin: true, Blocked: false, IP: "ae12fe3b5f129b5cc4cdd2b136b7b7947c4d2741"}, comment.User) @@ -190,7 +190,7 @@ func TestServer_Update(t *testing.T) { err = json.Unmarshal(body, &c2) assert.Nil(t, err) assert.Equal(t, id, c2.ID) - assert.Equal(t, "

updated text

", c2.Text) + assert.Equal(t, "

updated text

\n", c2.Text) assert.Equal(t, "my edit", c2.Edit.Summary) assert.True(t, time.Since(c2.Edit.Timestamp) < 1*time.Second) diff --git a/app/store/comment_test.go b/app/store/comment_test.go index 43e3b288..33713083 100644 --- a/app/store/comment_test.go +++ b/app/store/comment_test.go @@ -20,7 +20,7 @@ func TestComment_Sanitize(t *testing.T) { User: User{ID: `username`}, }, out: Comment{ - Text: `blah XSS`, + Text: "blah XSS\n\t", User: User{ID: `<a href="http://blah.com">username</a>`}, }, },