test for sortByRating