Add test for redirect handling