Refactor remove trailing slash middleware tests