Refactor tests shared examples