コード例 #1
0
 @Test
 public void renameProjectForbidden() {
   long id =
       Project.find
           .where()
           .eq("members.email", "*****@*****.**")
           .eq("name", "Tutorials")
           .findUnique()
           .id;
   Result result =
       callAction(
           controllers.routes.ref.Projects.rename(id),
           fakeRequest()
               .withSession("email", "*****@*****.**")
               .withFormUrlEncodedBody(ImmutableMap.of("name", "Private")));
   assertEquals(403, status(result));
   assertEquals("Tutorials", Project.find.byId(id).name);
 }
コード例 #2
0
ファイル: ProjectsTest.java プロジェクト: hewell/zentasks
 @Test
 public void renameProject() {
   long id =
       Project.find
           .where()
           .eq("members.email", "*****@*****.**")
           .eq("name", "Private")
           .findUnique()
           .id;
   Result result =
       callAction(
           controllers.routes.ref.Projects.rename(id),
           fakeRequest()
               .withSession("email", "*****@*****.**")
               .withFormUrlEncodedBody(ImmutableMap.of("name", "New name")));
   assertEquals(200, status(result));
   assertEquals("New name", Project.find.byId(id).name);
 }