From 52e11b24bf5e395d83ea58c1b0fd6922efe16add Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 17 Sep 2017 01:17:57 +0800 Subject: Restructure markup & markdown to prepare for multiple markup languageā€¦ (#2411) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * restructure markup & markdown to prepare for multiple markup languages support * adjust some functions between markdown and markup * fix tests * improve the comments --- routers/api/v1/misc/markdown_test.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'routers/api/v1/misc/markdown_test.go') diff --git a/routers/api/v1/misc/markdown_test.go b/routers/api/v1/misc/markdown_test.go index d6e6193478..8c3051ea8e 100644 --- a/routers/api/v1/misc/markdown_test.go +++ b/routers/api/v1/misc/markdown_test.go @@ -1,23 +1,21 @@ package misc import ( + "io/ioutil" "net/http" "net/http/httptest" - "testing" - - macaron "gopkg.in/macaron.v1" - "net/url" - - "io/ioutil" "strings" + "testing" "code.gitea.io/gitea/modules/context" - "code.gitea.io/gitea/modules/markdown" + "code.gitea.io/gitea/modules/markup" "code.gitea.io/gitea/modules/setting" api "code.gitea.io/sdk/gitea" + "github.com/go-macaron/inject" "github.com/stretchr/testify/assert" + macaron "gopkg.in/macaron.v1" ) const AppURL = "http://localhost:3000/" @@ -55,7 +53,7 @@ func TestAPI_RenderGFM(t *testing.T) { Context: Repo, Wiki: true, } - requrl, _ := url.Parse(markdown.URLJoin(AppURL, "api", "v1", "markdown")) + requrl, _ := url.Parse(markup.URLJoin(AppURL, "api", "v1", "markdown")) req := &http.Request{ Method: "POST", URL: requrl, @@ -149,7 +147,7 @@ func TestAPI_RenderSimple(t *testing.T) { Text: "", Context: Repo, } - requrl, _ := url.Parse(markdown.URLJoin(AppURL, "api", "v1", "markdown")) + requrl, _ := url.Parse(markup.URLJoin(AppURL, "api", "v1", "markdown")) req := &http.Request{ Method: "POST", URL: requrl, @@ -168,7 +166,7 @@ func TestAPI_RenderSimple(t *testing.T) { func TestAPI_RenderRaw(t *testing.T) { setting.AppURL = AppURL - requrl, _ := url.Parse(markdown.URLJoin(AppURL, "api", "v1", "markdown")) + requrl, _ := url.Parse(markup.URLJoin(AppURL, "api", "v1", "markdown")) req := &http.Request{ Method: "POST", URL: requrl, -- cgit v1.2.3