summaryrefslogtreecommitdiffstats
path: root/create/content_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-12-15 09:27:30 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-12-15 09:27:30 +0100
commitef03c6f95412494902aef40335d8666136fad558 (patch)
treea9f1910681f7a0903414d90f33f49ae169ae6350 /create/content_test.go
parente4ebe0d5bf9d25d7e30acd6fc18610d96abb3d6f (diff)
create: Allow empty dates in archetype in new
To make it behave the same as Hugo 0.17.
Diffstat (limited to 'create/content_test.go')
-rw-r--r--create/content_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/create/content_test.go b/create/content_test.go
index 279587258..cdee13fb8 100644
--- a/create/content_test.go
+++ b/create/content_test.go
@@ -42,6 +42,7 @@ func TestNewContent(t *testing.T) {
expected []string
}{
{"post", "post/sample-1.md", []string{`title = "Post Arch title"`, `test = "test1"`, "date = \"2015-01-12T19:20:04-07:00\""}},
+ {"emptydate", "post/sample-ed.md", []string{`title = "Empty Date Arch title"`, `test = "test1"`}},
{"stump", "stump/sample-2.md", []string{`title = "sample 2"`}}, // no archetype file
{"", "sample-3.md", []string{`title = "sample 3"`}}, // no archetype
{"product", "product/sample-4.md", []string{`title = "sample 4"`}}, // empty archetype front matter
@@ -105,6 +106,10 @@ func initFs() error {
path: filepath.Join("archetypes", "product.md"),
content: "+++\n+++\n",
},
+ {
+ path: filepath.Join("archetypes", "emptydate.md"),
+ content: "+++\ndate =\"\"\ntitle = \"Empty Date Arch title\"\ntest = \"test1\"\n+++\n",
+ },
} {
f, err := hugofs.Source().Create(v.path)
if err != nil {