Search in sources :

Example 1 with InstructorFeedbackDeleteAction

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

the class InstructorFeedbackDeleteActionTest method testExecuteAndPostProcess.

@Override
@Test
public void testExecuteAndPostProcess() {
    FeedbackSessionsDb fsDb = new FeedbackSessionsDb();
    FeedbackSessionAttributes fs = typicalBundle.feedbackSessions.get("session1InCourse1");
    String[] submissionParams = new String[] { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName() };
    InstructorAttributes instructor = typicalBundle.instructors.get("instructor1OfCourse1");
    gaeSimulation.loginAsInstructor(instructor.googleId);
    assertNotNull(fsDb.getFeedbackSession(fs.getCourseId(), fs.getFeedbackSessionName()));
    InstructorFeedbackDeleteAction a = getAction(submissionParams);
    RedirectResult r = getRedirectResult(a);
    assertNull(fsDb.getFeedbackSession(fs.getCourseId(), fs.getFeedbackSessionName()));
    assertEquals(getPageResultDestination(Const.ActionURIs.INSTRUCTOR_FEEDBACK_SESSIONS_PAGE, false, "idOfInstructor1OfCourse1"), r.getDestinationWithParams());
    assertEquals(Const.StatusMessages.FEEDBACK_SESSION_DELETED, r.getStatusMessage());
    assertFalse(r.isError);
}
Also used : FeedbackSessionsDb(teammates.storage.api.FeedbackSessionsDb) FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) InstructorFeedbackDeleteAction(teammates.ui.controller.InstructorFeedbackDeleteAction) RedirectResult(teammates.ui.controller.RedirectResult) InstructorAttributes(teammates.common.datatransfer.attributes.InstructorAttributes) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)1 FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)1 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)1 FeedbackSessionsDb (teammates.storage.api.FeedbackSessionsDb)1 InstructorFeedbackDeleteAction (teammates.ui.controller.InstructorFeedbackDeleteAction)1 RedirectResult (teammates.ui.controller.RedirectResult)1