tests for the middleware