Search in sources :

Example 11 with Response

use of play.mvc.Http.Response in project play-cookbook by spinscale.

the class UserRightTest method testSecretsAreDeniedForUser.

@Test
public void testSecretsAreDeniedForUser() {
    login("user", "user");
    Response response = GET("/top-secret");
    assertStatus(403, response);
}
Also used : Response(play.mvc.Http.Response) FunctionalTest(play.test.FunctionalTest) Test(org.junit.Test)

Example 12 with Response

use of play.mvc.Http.Response in project play-cookbook by spinscale.

the class UserRightTest method testSecretsWork.

@Test
public void testSecretsWork() {
    login("user", "user");
    Response response = GET("/secret");
    assertIsOk(response);
    assertContentEquals("This is secret", response);
}
Also used : Response(play.mvc.Http.Response) FunctionalTest(play.test.FunctionalTest) Test(org.junit.Test)

Example 13 with Response

use of play.mvc.Http.Response in project play-cookbook by spinscale.

the class UserRightTest method testSuperSecretsAreAllowedForAdmin.

@Test
public void testSuperSecretsAreAllowedForAdmin() {
    login("admin", "admin");
    Response response = GET("/top-secret");
    assertIsOk(response);
    assertContentEquals("This is top secret", response);
}
Also used : Response(play.mvc.Http.Response) FunctionalTest(play.test.FunctionalTest) Test(org.junit.Test)

Aggregations

Response (play.mvc.Http.Response)13 Test (org.junit.Test)12 FunctionalTest (play.test.FunctionalTest)12 SyndFeed (com.sun.syndication.feed.synd.SyndFeed)3 Gson (com.google.gson.Gson)1 User (models.User)1 DateTime (org.joda.time.DateTime)1 Header (play.mvc.Http.Header)1 Request (play.mvc.Http.Request)1