use of org.takes.rs.RsPrint in project wring by yegor256.
the class TkAppTest method rendersHomePage.
/**
* App can render front page.
* @throws Exception If some problem inside
*/
@Test
public void rendersHomePage() throws Exception {
final Take take = new TkApp(new FkBase());
MatcherAssert.assertThat(XhtmlMatchers.xhtml(new RsPrint(take.act(new RqWithHeaders(new RqFake("GET", "/"), "Accept: text/xml"))).printBody()), XhtmlMatchers.hasXPaths("/page/millis", "/page/links/link[@rel='takes:github']"));
}
use of org.takes.rs.RsPrint in project wring by yegor256.
the class TkEventsTest method rendersListOfEvents.
/**
* TkEvents can render list of events.
* @throws Exception If some problem inside
*/
@Test
public void rendersListOfEvents() throws Exception {
final Take take = new TkAppAuth(new TkEvents(new FkBase()));
MatcherAssert.assertThat(XhtmlMatchers.xhtml(new RsPrint(take.act(new RqWithHeader(new RqFake("GET", "/"), "Accept", "text/xml"))).printBody()), XhtmlMatchers.hasXPaths("/page/millis", "/page/events/event", "/page/events/@total"));
}
use of org.takes.rs.RsPrint in project wring by yegor256.
the class TkFaviconTest method rendersIcon.
/**
* TkFavicon can render home page.
* @throws Exception If some problem inside
*/
@Test
public void rendersIcon() throws Exception {
final Take take = new TkAppAuth(new TkFavicon(new FkBase()));
MatcherAssert.assertThat(new RsPrint(take.act(new RqFake())).printBody(), Matchers.notNullValue());
}
use of org.takes.rs.RsPrint in project wring by yegor256.
the class TkIndexTest method rendersHomePage.
/**
* TkHome can render home page.
* @throws Exception If some problem inside
*/
@Test
public void rendersHomePage() throws Exception {
final Take take = new TkIndex(new FkBase());
MatcherAssert.assertThat(XhtmlMatchers.xhtml(new RsPrint(take.act(new RqWithHeader(new RqFake("GET", "/"), "Accept", "text/xml"))).printBody()), XhtmlMatchers.hasXPaths("/page/millis", "/page/links/link[@rel='takes:github']", "/page/total"));
}
Aggregations