Added test for DescriptionHTML
Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
This commit is contained in:
parent
a1f01b0d71
commit
bf02f8d816
|
@ -5,6 +5,7 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
|
@ -176,3 +177,14 @@ func TestTransferOwnership(t *testing.T) {
|
|||
|
||||
CheckConsistencyFor(t, &Repository{}, &User{}, &Team{})
|
||||
}
|
||||
|
||||
func TestRepoDescriptionHTML(t *testing.T) {
|
||||
url := "https://github.com/go-gitea/gitea"
|
||||
description := "GitHub repo: (%s)"
|
||||
repo := &Repository{Description: fmt.Sprintf(description, url)}
|
||||
|
||||
actual := repo.DescriptionHTML()
|
||||
expected := fmt.Sprintf(description,
|
||||
fmt.Sprintf(`<a href="%[1]s">%[1]s</a>`, url))
|
||||
assert.EqualValues(t, expected, actual)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user