Testing $scope.$apply()