use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestListGenerator method testEmptyList.
@Test
public void testEmptyList() {
HttpRequest req = Requests.createRequest(KnownHttpMethod.GET, "/emptyList");
http11Socket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(http11Socket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertNotContains("<td>dean</td><td>5</td><td>red</td>");
response.assertNotContains("<td>jeff</td><td>2</td><td>blue</td");
response.assertContains("You have no accounts at this time");
}
use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestAHrefTag method testAHref.
@Test
public void testAHref() {
HttpRequest req = Requests.createRequest(KnownHttpMethod.GET, "/ahref");
http11Socket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(http11Socket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("<a href=`/verbatim` id=`myid`>My link2</a>".replace('`', '"'));
response.assertContains("<a href=`/if`>My render link2</a>".replace('`', '"'));
response.assertContains("<a href=`/else`>My full route link</a>".replace('`', '"'));
response.assertContains("<a href=`/redirect/Dean+Hiller`>PureALink</a>".replace('`', '"'));
response.assertContains("Link but no ahref='/redirect/Dean+Hiller'");
}
use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestBootstrapTag method testBootstrap.
@Test
public void testBootstrap() {
HttpRequest req = Requests.createRequest(KnownHttpMethod.GET, "/bootstrap");
http11Socket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(http11Socket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("$(`#editLink_2`).click(function(e){".replaceAll("`", "\""));
response.assertContains("$('#addEditModal').load('/user/2', function(response, status, xhr){");
response.assertContains("$(`#editLink_4`).click(function(e){".replaceAll("`", "\""));
response.assertContains("$('#addEditModal').load('/user/2', function(response, status, xhr){");
}
use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestStaticPaths method testStaticDirWithHashLoad.
@Test
public void testStaticDirWithHashLoad() throws FileNotFoundException, IOException {
String hash = loadUrlEncodedHash();
HttpRequest req = Requests.createRequest(KnownHttpMethod.GET, "/public/fonts.css?hash=" + hash);
http11Socket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(http11Socket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("themes.googleusercontent.com");
response.assertContentType("text/css; charset=utf-8");
}
use of org.webpieces.httpparser.api.dto.HttpRequest in project webpieces by deanhiller.
the class TestStaticPaths method testStaticFile.
@Test
public void testStaticFile() {
HttpRequest req = Requests.createRequest(KnownHttpMethod.GET, "/public/myfile");
http11Socket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(http11Socket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("app.TagsMeta");
}
Aggregations