Testing CheckPending middleware

Could not found any test for this.