|
|
@ -1,10 +1,11 @@ |
|
|
|
package models_test |
|
|
|
package models_test |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
. "github.com/gogits/gogs/models" |
|
|
|
|
|
|
|
. "github.com/smartystreets/goconvey/convey" |
|
|
|
|
|
|
|
"testing" |
|
|
|
"testing" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
. "github.com/smartystreets/goconvey/convey" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
. "github.com/gogits/gogs/models" |
|
|
|
"github.com/gogits/gogs/modules/markup" |
|
|
|
"github.com/gogits/gogs/modules/markup" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
@ -24,7 +25,7 @@ func TestRepo(t *testing.T) { |
|
|
|
Convey("It should be nil even if other settings are present", func() { |
|
|
|
Convey("It should be nil even if other settings are present", func() { |
|
|
|
repo.EnableExternalTracker = false |
|
|
|
repo.EnableExternalTracker = false |
|
|
|
repo.ExternalTrackerFormat = "http://someurl.com/{user}/{repo}/{issue}" |
|
|
|
repo.ExternalTrackerFormat = "http://someurl.com/{user}/{repo}/{issue}" |
|
|
|
repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_NUMERIC |
|
|
|
repo.ExternalTrackerStyle = markup.ISSUE_NAME_STYLE_NUMERIC |
|
|
|
So(repo.ComposeMetas(), ShouldEqual, map[string]string(nil)) |
|
|
|
So(repo.ComposeMetas(), ShouldEqual, map[string]string(nil)) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
@ -33,17 +34,17 @@ func TestRepo(t *testing.T) { |
|
|
|
repo.EnableExternalTracker = true |
|
|
|
repo.EnableExternalTracker = true |
|
|
|
Convey("It should default to numeric issue style", func() { |
|
|
|
Convey("It should default to numeric issue style", func() { |
|
|
|
metas := repo.ComposeMetas() |
|
|
|
metas := repo.ComposeMetas() |
|
|
|
So(metas["style"], ShouldEqual, markdown.ISSUE_NAME_STYLE_NUMERIC) |
|
|
|
So(metas["style"], ShouldEqual, markup.ISSUE_NAME_STYLE_NUMERIC) |
|
|
|
}) |
|
|
|
}) |
|
|
|
Convey("It should pass through numeric issue style setting", func() { |
|
|
|
Convey("It should pass through numeric issue style setting", func() { |
|
|
|
repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_NUMERIC |
|
|
|
repo.ExternalTrackerStyle = markup.ISSUE_NAME_STYLE_NUMERIC |
|
|
|
metas := repo.ComposeMetas() |
|
|
|
metas := repo.ComposeMetas() |
|
|
|
So(metas["style"], ShouldEqual, markdown.ISSUE_NAME_STYLE_NUMERIC) |
|
|
|
So(metas["style"], ShouldEqual, markup.ISSUE_NAME_STYLE_NUMERIC) |
|
|
|
}) |
|
|
|
}) |
|
|
|
Convey("It should pass through alphanumeric issue style setting", func() { |
|
|
|
Convey("It should pass through alphanumeric issue style setting", func() { |
|
|
|
repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_ALPHANUMERIC |
|
|
|
repo.ExternalTrackerStyle = markup.ISSUE_NAME_STYLE_ALPHANUMERIC |
|
|
|
metas := repo.ComposeMetas() |
|
|
|
metas := repo.ComposeMetas() |
|
|
|
So(metas["style"], ShouldEqual, markdown.ISSUE_NAME_STYLE_ALPHANUMERIC) |
|
|
|
So(metas["style"], ShouldEqual, markup.ISSUE_NAME_STYLE_ALPHANUMERIC) |
|
|
|
}) |
|
|
|
}) |
|
|
|
Convey("It should contain the user name", func() { |
|
|
|
Convey("It should contain the user name", func() { |
|
|
|
metas := repo.ComposeMetas() |
|
|
|
metas := repo.ComposeMetas() |
|
|
|