Completed basic tests for middlware