test/hightop_test.rb in hightop-0.1.1 vs test/hightop_test.rb in hightop-0.1.2
- old
+ new
@@ -70,9 +70,18 @@
"San Francisco" => 1
}
assert_equal expected, Visit.top(:city, uniq: :user_id)
end
+ def test_min
+ create_city("San Francisco", 3)
+ create_city("Chicago", 2)
+ expected = {
+ "San Francisco" => 3
+ }
+ assert_equal expected, Visit.top(:city, min: 3)
+ end
+
def create_city(city, count = 1)
create({city: city}, count)
end
def create(attributes, count = 1)