Add test for middleware disabling