test/boost_test.rb in searchkick-2.0.1 vs test/boost_test.rb in searchkick-2.0.2

- old
+ new

@@ -136,9 +136,27 @@ {name: "San Marino", latitude: 43.9333, longitude: 12.4667} ] assert_order "san", ["San Francisco", "San Antonio", "San Marino"], boost_by_distance: {field: :location, origin: {lat: 37, lon: -122}, scale: "1000mi"} end + def test_boost_by_distance_v2 + store [ + {name: "San Francisco", latitude: 37.7833, longitude: -122.4167}, + {name: "San Antonio", latitude: 29.4167, longitude: -98.5000}, + {name: "San Marino", latitude: 43.9333, longitude: 12.4667} + ] + assert_order "san", ["San Francisco", "San Antonio", "San Marino"], boost_by_distance: {location: {origin: [37, -122], scale: "1000mi"}} + end + + def test_boost_by_distance_v2_hash + store [ + {name: "San Francisco", latitude: 37.7833, longitude: -122.4167}, + {name: "San Antonio", latitude: 29.4167, longitude: -98.5000}, + {name: "San Marino", latitude: 43.9333, longitude: 12.4667} + ] + assert_order "san", ["San Francisco", "San Antonio", "San Marino"], boost_by_distance: {location: {origin: {lat: 37, lon: -122}, scale: "1000mi"}} + end + def test_boost_by_indices store_names ["Rex"], Animal store_names ["Rexx"], Product assert_order "Rex", ["Rexx", "Rex"], {index_name: [Animal, Product], indices_boost: {Animal => 1, Product => 200}, fields: [:name]}, Store