Skip to content

Commit

Permalink
Added test to cover #217.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbullock committed Jun 24, 2016
1 parent a173a33 commit 809c197
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/test/java/org/jbake/app/CrawlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Date;
import java.util.List;
import java.util.Map;

Expand All @@ -13,6 +14,7 @@
import org.apache.commons.configuration.CompositeConfiguration;
import org.apache.commons.configuration.ConfigurationException;
import org.jbake.app.ConfigUtil.Keys;

import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -71,6 +73,14 @@ public void crawl() throws ConfigurationException {
.containsValue("../../");
}

List<ODocument> draftPosts = db.getAllContent("post");
DocumentList draftList = DocumentList.wrap(draftPosts.iterator());
for (Map<String,Object> content : list) {
if (content.get(Crawler.Attributes.TITLE).equals("Draft Post")) {
assertThat(content).containsKey(Crawler.Attributes.DATE);
}
}

// covers bug #213
List<ODocument> publishedPostsByTag = db.getPublishedPostsByTag("blog");
Assert.assertEquals(2, publishedPostsByTag.size());
Expand Down
1 change: 0 additions & 1 deletion src/test/resources/content/blog/2016/draft-post.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
title=Draft Post
date=2016-06-22
type=post
tags=blog
status=draft
Expand Down

0 comments on commit 809c197

Please sign in to comment.