Search in sources :

Example 6 with Take

use of org.takes.Take 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"));
}
Also used : Take(org.takes.Take) FkBase(io.wring.fake.FkBase) RqFake(org.takes.rq.RqFake) RsPrint(org.takes.rs.RsPrint) RqWithHeader(org.takes.rq.RqWithHeader) Test(org.junit.Test)

Aggregations

FkBase (io.wring.fake.FkBase)6 Test (org.junit.Test)6 Take (org.takes.Take)6 RqFake (org.takes.rq.RqFake)5 RsPrint (org.takes.rs.RsPrint)4 RqWithHeader (org.takes.rq.RqWithHeader)2 JdkRequest (com.jcabi.http.request.JdkRequest)1 RestResponse (com.jcabi.http.response.RestResponse)1 XmlResponse (com.jcabi.http.response.XmlResponse)1 HmRsStatus (org.takes.facets.hamcrest.HmRsStatus)1 FtRemote (org.takes.http.FtRemote)1 RqWithHeaders (org.takes.rq.RqWithHeaders)1