Commit a29c4a82546e76a12f8e2c9917a6a3be01e2a256
1 parent
79574478
Exists in
master
and in
5 other branches
Fixed tests
Showing
2 changed files
with
7 additions
and
4 deletions
Show diff stats
README.md
@@ -939,7 +939,7 @@ Restaurant.search "sushi", where: {location: {top_left: {lat: 38, lon: -123}, bo | @@ -939,7 +939,7 @@ Restaurant.search "sushi", where: {location: {top_left: {lat: 38, lon: -123}, bo | ||
939 | Bounded by a polygon | 939 | Bounded by a polygon |
940 | 940 | ||
941 | ```ruby | 941 | ```ruby |
942 | -Restaurant.search "dessert", where: {location: {geo_shape: {type: "polygon", coordinates: [[{lat: 38, lon: -123}, {lat: 39, lon: -123}, {lat: 37, lon: 122}, {lat: 38, lon: -123}]]}}} | 942 | +Restaurant.search "dessert", where: {location: {geo_polygon: {points: [{lat: 38, lon: -123}, {lat: 39, lon: -123}, {lat: 37, lon: 122}]}}} |
943 | ``` | 943 | ``` |
944 | 944 | ||
945 | ### Boost By Distance | 945 | ### Boost By Distance |
test/where_test.rb
@@ -298,9 +298,12 @@ class WhereTest < Minitest::Test | @@ -298,9 +298,12 @@ class WhereTest < Minitest::Test | ||
298 | assert_match "Deprecated field [geo_polygon] used", stderr | 298 | assert_match "Deprecated field [geo_polygon] used", stderr |
299 | end | 299 | end |
300 | 300 | ||
301 | - # see test/geo_shape_test.rb for other geo_shape tests | ||
302 | - polygon << polygon.first | ||
303 | - assert_search "san", ["San Francisco", "San Antonio"], where: {location: {geo_shape: {type: "polygon", coordinates: [polygon]}}} | 301 | + # Field [location] is not of type [geo_shape] but of type [geo_point] error for previous versions |
302 | + unless Searchkick.server_below?("7.14.0") | ||
303 | + polygon << polygon.first | ||
304 | + # see test/geo_shape_test.rb for other geo_shape tests | ||
305 | + assert_search "san", ["San Francisco", "San Antonio"], where: {location: {geo_shape: {type: "polygon", coordinates: [polygon]}}} | ||
306 | + end | ||
304 | end | 307 | end |
305 | 308 | ||
306 | def test_top_left_bottom_right | 309 | def test_top_left_bottom_right |