Search in sources :

Example 6 with StudentProfilePictureEditAction

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

the class StudentProfilePictureEditActionTest method testActionForNonExistentBlobKey.

private void testActionForNonExistentBlobKey(AccountAttributes student) {
    ______TS("Failure case: non-existent blobKey");
    String expectedUrl = getPageResultDestination(Const.ActionURIs.STUDENT_PROFILE_PAGE, true, student.googleId);
    String[] submissionParams = createValidParamsForProfilePictureEdit();
    StudentProfilePictureEditAction action = getAction(submissionParams);
    RedirectResult result = getRedirectResult(action);
    String expectedLogMessage = getExpectedLogMessageNonExistentBlob(student);
    AssertHelper.assertLogMessageEquals(expectedLogMessage, action.getLogMessage());
    assertEquals(expectedUrl, result.getDestinationWithParams());
}
Also used : RedirectResult(teammates.ui.controller.RedirectResult) StudentProfilePictureEditAction(teammates.ui.controller.StudentProfilePictureEditAction)

Example 7 with StudentProfilePictureEditAction

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

the class StudentProfilePictureEditActionTest method testActionForEmptyLeftX.

private void testActionForEmptyLeftX(AccountAttributes student) {
    ______TS("Failure case: empty parameter - leftx");
    String expectedUrl = getPageResultDestination(Const.ActionURIs.STUDENT_PROFILE_PAGE, true, student.googleId);
    String[] submissionParams = createValidParamsForProfilePictureEdit();
    submissionParams[1] = "";
    StudentProfilePictureEditAction action = getAction(submissionParams);
    RedirectResult result = getRedirectResult(action);
    String expectedLogMessage = getExpectedLogMessageEmptyCoords(student);
    AssertHelper.assertLogMessageEquals(expectedLogMessage, action.getLogMessage());
    assertEquals(expectedUrl, result.getDestinationWithParams());
}
Also used : RedirectResult(teammates.ui.controller.RedirectResult) StudentProfilePictureEditAction(teammates.ui.controller.StudentProfilePictureEditAction)

Example 8 with StudentProfilePictureEditAction

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

the class StudentProfilePictureEditActionTest method testActionForZeroHeight.

private void testActionForZeroHeight(AccountAttributes student) {
    ______TS("Failure case: zero height");
    String expectedLogMessage = getExpectedLogMessageZeroDimensions(student);
    String expectedUrl = getPageResultDestination(Const.ActionURIs.STUDENT_PROFILE_PAGE, true, student.googleId);
    String[] submissionParams = createValidParamsForProfilePictureEdit();
    submissionParams[9] = "0";
    StudentProfilePictureEditAction action = getAction(submissionParams);
    RedirectResult result = getRedirectResult(action);
    AssertHelper.assertLogMessageEquals(expectedLogMessage, action.getLogMessage());
    assertEquals(expectedUrl, result.getDestinationWithParams());
}
Also used : RedirectResult(teammates.ui.controller.RedirectResult) StudentProfilePictureEditAction(teammates.ui.controller.StudentProfilePictureEditAction)

Example 9 with StudentProfilePictureEditAction

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

the class StudentProfilePictureEditActionTest method testActionForEmptyRightY.

private void testActionForEmptyRightY(AccountAttributes student) {
    String[] submissionParams;
    ______TS("Failure case: empty parameter - rightx");
    String expectedLogMessage = getExpectedLogMessageEmptyCoords(student);
    String expectedUrl = getPageResultDestination(Const.ActionURIs.STUDENT_PROFILE_PAGE, true, student.googleId);
    submissionParams = createValidParamsForProfilePictureEdit();
    submissionParams[3] = "";
    StudentProfilePictureEditAction action = getAction(submissionParams);
    RedirectResult result = getRedirectResult(action);
    AssertHelper.assertLogMessageEquals(expectedLogMessage, action.getLogMessage());
    assertEquals(expectedUrl, result.getDestinationWithParams());
}
Also used : RedirectResult(teammates.ui.controller.RedirectResult) StudentProfilePictureEditAction(teammates.ui.controller.StudentProfilePictureEditAction)

Aggregations

RedirectResult (teammates.ui.controller.RedirectResult)9 StudentProfilePictureEditAction (teammates.ui.controller.StudentProfilePictureEditAction)9