Add more directory middleware tests