refactored redirect into $routeChangeSuccess in config file and changed tests code by adding $broadcast for $routeChangeSuccess