owl-blogs/post_test.go

25 lines
477 B
Go
Raw Normal View History

2022-08-03 14:55:48 +00:00
package owl_test
2022-07-21 17:44:07 +00:00
2022-08-01 17:50:29 +00:00
import (
"path"
"testing"
)
2022-07-21 17:44:07 +00:00
func TestCanGetPostTitle(t *testing.T) {
user := getTestUser()
post, _ := user.CreateNewPost("testpost")
result := post.Title()
if result != "testpost" {
t.Error("Wrong Title. Got: " + result)
}
}
2022-08-01 17:50:29 +00:00
func TestMediaDir(t *testing.T) {
user := getTestUser()
post, _ := user.CreateNewPost("testpost")
result := post.MediaDir()
if result != path.Join(post.Dir(), "media") {
t.Error("Wrong MediaDir. Got: " + result)
}
}