Add leaveDoc acceptance tests