Added two tests for the middleware