refactor documents controller tests