@Test
public void createNewPageBasedOnTemplate() throws Exception {
final String newContent = "To be saved data";
final String dummyKey = "DummyKey";
WikiPage template = WikiPageUtil.addPage(root, PathParser.parse("TemplatePage"), "Template data");
PageData templateData = template.getData();
templateData.setAttribute(dummyKey, "true");
template.commit(templateData);
request.setResource("");
request.addInput(EditResponder.PAGE_NAME, "TestChildPage");
request.addInput(EditResponder.CONTENT_INPUT_NAME, newContent);
request.addInput(EditResponder.TIME_STAMP, "" + SaveRecorder.timeStamp());
request.addInput(EditResponder.TICKET_ID, "" + SaveRecorder.newTicket());
request.addInput(NewPageResponder.PAGE_TEMPLATE, ".TemplatePage");
responder.makeResponse(FitNesseUtil.makeTestContext(root), request);
WikiPage newPage = root.getChildPage("TestChildPage");
assertNotNull(newPage);
assertTrue(newPage.getData().hasAttribute(dummyKey));
assertEquals("true", newPage.getData().getAttribute(dummyKey));
assertEquals(newContent, newPage.getData().getContent());
}