Search in sources :

Example 1 with ConfirmInvitePageModel

use of org.activityinfo.server.login.model.ConfirmInvitePageModel in project activityinfo by bedatadriven.

the class ConfirmInviteControllerTest method emptyPasswordShouldNotBeAccepted.

@Test
public void emptyPasswordShouldNotBeAccepted() throws Exception {
    Response response = resource.confirm(RestMockUtils.mockUriInfo("http://www.activityinfo.org/confirm"), VALID_KEY, "fr", null, "Alex Bertram", false);
    Viewable viewable = (Viewable) response.getEntity();
    assertThat(viewable.getModel(), instanceOf(ConfirmInvitePageModel.class));
    ConfirmInvitePageModel model = (ConfirmInvitePageModel) viewable.getModel();
    assertTrue("error message set", model.isFormIncomplete());
}
Also used : Response(javax.ws.rs.core.Response) ConfirmInvitePageModel(org.activityinfo.server.login.model.ConfirmInvitePageModel) Viewable(com.sun.jersey.api.view.Viewable) Test(org.junit.Test)

Example 2 with ConfirmInvitePageModel

use of org.activityinfo.server.login.model.ConfirmInvitePageModel in project activityinfo by bedatadriven.

the class ConfirmInviteViewTest method templateProcesses.

@Test
public void templateProcesses() {
    User user = new User();
    user.setName("Alex");
    user.setEmail("alex@bertram");
    user.setChangePasswordKey("ABC12345");
    user.setLocale("en");
    assertProcessable(new ConfirmInvitePageModel(user));
}
Also used : ConfirmInvitePageModel(org.activityinfo.server.login.model.ConfirmInvitePageModel) User(org.activityinfo.server.database.hibernate.entity.User) Test(org.junit.Test)

Aggregations

ConfirmInvitePageModel (org.activityinfo.server.login.model.ConfirmInvitePageModel)2 Test (org.junit.Test)2 Viewable (com.sun.jersey.api.view.Viewable)1 Response (javax.ws.rs.core.Response)1 User (org.activityinfo.server.database.hibernate.entity.User)1