Search in sources :

Example 1 with StudentProfilePageAction

use of teammates.ui.controller.StudentProfilePageAction in project teammates by TEAMMATES.

the class StudentProfilePageActionTest method testActionSuccess.

private void testActionSuccess(AccountAttributes student, String caseDescription) {
    gaeSimulation.loginAsStudent(student.googleId);
    ______TS(caseDescription);
    String[] submissionParams = new String[] {};
    StudentProfilePageAction action = getAction(submissionParams);
    ShowPageResult result = getShowPageResult(action);
    AssertHelper.assertContains(getPageResultDestination(Const.ViewURIs.STUDENT_PROFILE_PAGE, false, student.googleId), result.getDestinationWithParams());
    assertFalse(result.isError);
    assertEquals("", result.getStatusMessage());
    verifyAccountsAreSame(student, result);
    verifyLogMessage(student, action, false);
}
Also used : ShowPageResult(teammates.ui.controller.ShowPageResult) StudentProfilePageAction(teammates.ui.controller.StudentProfilePageAction)

Example 2 with StudentProfilePageAction

use of teammates.ui.controller.StudentProfilePageAction in project teammates by TEAMMATES.

the class StudentProfilePageActionTest method testActionInMasquerade.

private void testActionInMasquerade(AccountAttributes student) {
    gaeSimulation.loginAsAdmin("admin.user");
    ______TS("Typical case: masquerade mode");
    String[] submissionParams = new String[] { Const.ParamsNames.STUDENT_PROFILE_PHOTOEDIT, "false", Const.ParamsNames.USER_ID, student.googleId };
    StudentProfilePageAction action = getAction(addUserIdToParams(student.googleId, submissionParams));
    ShowPageResult result = getShowPageResult(action);
    AssertHelper.assertContains(getPageResultDestination(Const.ViewURIs.STUDENT_PROFILE_PAGE, false, student.googleId), result.getDestinationWithParams());
    assertFalse(result.isError);
    assertEquals("", result.getStatusMessage());
    verifyAccountsAreSame(student, result);
    verifyLogMessage(student, action, true);
}
Also used : ShowPageResult(teammates.ui.controller.ShowPageResult) StudentProfilePageAction(teammates.ui.controller.StudentProfilePageAction)

Aggregations

ShowPageResult (teammates.ui.controller.ShowPageResult)2 StudentProfilePageAction (teammates.ui.controller.StudentProfilePageAction)2