Add more tests to helper

This commit is contained in:
bep
2015-01-27 10:15:57 +01:00
parent de76d4a84e
commit 5f9596e68c
3 changed files with 52 additions and 8 deletions

View File

@@ -1,6 +1,8 @@
package helpers
import (
"github.com/stretchr/testify/assert"
"html/template"
"testing"
)
@@ -20,3 +22,12 @@ func TestStripHTML(t *testing.T) {
}
}
}
func TestStripEmptyNav(t *testing.T) {
cleaned := StripEmptyNav([]byte("do<nav>\n</nav>\n\nbedobedo"))
assert.Equal(t, []byte("dobedobedo"), cleaned)
}
func TestBytesToHTML(t *testing.T) {
assert.Equal(t, template.HTML("dobedobedo"), BytesToHTML([]byte("dobedobedo")))
}