added tests for redirect middleware