Added specs for isAncestor utility function