use of org.webpieces.webserver.test.FullResponse 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.webserver.test.FullResponse 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.webserver.test.FullResponse 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");
}
use of org.webpieces.webserver.test.FullResponse in project webpieces by deanhiller.
the class TestIfGenerator method testElseIFTag.
@Test
public void testElseIFTag() {
HttpRequest req = Requests.createRequest(KnownHttpMethod.GET, "/elseif");
http11Socket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(http11Socket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertNotContains("This should not exist");
response.assertContains("This should exist");
response.assertContains("ElseIf1");
}
use of org.webpieces.webserver.test.FullResponse in project webpieces by deanhiller.
the class TestIfGenerator method testIfTag.
@Test
public void testIfTag() {
HttpRequest req = Requests.createRequest(KnownHttpMethod.GET, "/if");
http11Socket.send(req);
FullResponse response = ResponseExtract.assertSingleResponse(http11Socket);
response.assertStatusCode(KnownStatusCode.HTTP_200_OK);
response.assertContains("This should exist");
response.assertNotContains("Negative1");
response.assertNotContains("Negative2");
}
Aggregations