コード例 #1
0
  public void testShouldNotDisplayRevertActionForLocalUnchangedPages() throws Exception {
    expectStateOfPageIs(FS_PARENT_PAGE, VERSIONED);
    replay(revisionController);

    createPage(FS_PARENT_PAGE);

    request.setResource(FS_PARENT_PAGE);
    invokeResponderAndCheckResponseContains();
    assertActionIsNotPresent(RevisionControlOperation.CHECKIN);
    assertActionIsPresent(RevisionControlOperation.UPDATE);
    assertActionIsNotPresent(RevisionControlOperation.REVERT);
    assertActionIsPresent(RevisionControlOperation.STATUS);
  }
コード例 #2
0
  public void testShouldMakeAddToRevisionControlActionForPages() throws Exception {
    expectStateOfPageIs(FS_PARENT_PAGE, UNKNOWN);
    replay(revisionController);

    createPage(FS_PARENT_PAGE);

    request.setResource(FS_PARENT_PAGE);
    invokeResponderAndCheckResponseContains();
    assertActionIsPresent(RevisionControlOperation.ADD);
    assertActionIsNotPresent(RevisionControlOperation.CHECKIN);
    assertActionIsNotPresent(RevisionControlOperation.CHECKIN);
    assertActionIsNotPresent(RevisionControlOperation.REVERT);
    assertActionIsNotPresent(RevisionControlOperation.STATUS);
  }
コード例 #3
0
  public void testShouldNotMakeRevisionControlActionsIfPageIsNotEditableNorImported()
      throws Exception {
    expectStateOfPageIs(FS_PARENT_PAGE, VERSIONED);
    replay(revisionController);

    createPage(FS_PARENT_PAGE);

    final PageData pageData = parentPage.getData();
    pageData.removeAttribute("Edit");
    parentPage.commit(pageData);

    request.setResource(FS_PARENT_PAGE);
    invokeResponderAndCheckResponseContains();
    assertRevisionControlItemsNotDisplayed();
  }