In test for #38, we should check the real file name as we have it :-).

This commit is contained in:
David Pilato 2013-08-20 12:34:33 +02:00
parent 019d0f9a26
commit 406e295c6c
1 changed files with 2 additions and 2 deletions

View File

@ -37,14 +37,14 @@ public class MetadataMapperTest {
.startObject()
.field("_id", 1)
.startObject("file")
.field("_name", "htmlWithoutDateMeta.html")
.field("_name", filename)
.field("content", html)
.endObject()
.endObject().bytes();
Document doc = docMapper.parse(json).rootDoc();
assertThat(doc.get(docMapper.mappers().smartName("file").mapper().names().indexName()), containsString("World"));
assertThat(doc.get(docMapper.mappers().smartName("file.name").mapper().names().indexName()), equalTo("htmlWithoutDateMeta.html"));
assertThat(doc.get(docMapper.mappers().smartName("file.name").mapper().names().indexName()), equalTo(filename));
if (expected == null) {
assertThat(doc.getField(docMapper.mappers().smartName("file.date").mapper().names().indexName()), nullValue());
} else {