fix test to expect post-markdown render

This commit is contained in:
Umputun
2018-01-14 13:31:18 -06:00
parent 772272062b
commit 4f1ae2ea6b
+3 -3
View File
@@ -60,7 +60,7 @@ func TestServer_CreateAndGet(t *testing.T) {
defer cleanup(srv)
// create comment
r := strings.NewReader(`{"text": "test 123", "locator":{"url": "https://radio-t.com/blah1", "site": "radio-t"}}`)
r := strings.NewReader(`{"text": "test *123*", "locator":{"url": "https://radio-t.com/blah1", "site": "radio-t"}}`)
resp, err := http.Post(fmt.Sprintf("http://127.0.0.1:%d/api/v1/comment", port), "application/json", r)
assert.Nil(t, err)
assert.Equal(t, http.StatusCreated, resp.StatusCode)
@@ -78,7 +78,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", comment.Text)
assert.Equal(t, "<p>test <em>123</em></p>", comment.Text)
assert.Equal(t, store.User{Name: "developer one", ID: "dev",
Picture: "https://friends.radio-t.com/resources/images/rt_logo_64.png",
Profile: "https://radio-t.com/info/", Admin: true, Blocked: false, IP: ""},
@@ -148,7 +148,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, "<p>updated text</p>", c2.Text)
assert.Equal(t, "my edit", c2.Edit.Summary)
assert.True(t, time.Since(c2.Edit.Timestamp) < 1*time.Second)