Commit 72d6ff771daabeead370aa38fd0deadf3ba17310

Authored by Andrew Kane
1 parent 7b4227e2

Fixed tests for Elasticsearch 8 [skip ci]

Showing 1 changed file with 10 additions and 2 deletions   Show diff stats
test/misspellings_test.rb
... ... @@ -13,13 +13,21 @@ class MisspellingsTest < Minitest::Test
13 13  
14 14 def test_prefix_length
15 15 store_names ["ap", "api", "apt", "any", "nap", "ah", "ahi"]
16   - assert_search "ap", ["ap"], misspellings: {prefix_length: 2}
  16 + if Searchkick.server_below?("8.0.0")
  17 + assert_search "ap", ["ap"], misspellings: {prefix_length: 2}
  18 + else
  19 + assert_search "ap", ["ap", "api", "apt"], misspellings: {prefix_length: 2}
  20 + end
17 21 assert_search "api", ["ap", "api", "apt"], misspellings: {prefix_length: 2}
18 22 end
19 23  
20 24 def test_prefix_length_operator
21 25 store_names ["ap", "api", "apt", "any", "nap", "ah", "aha"]
22   - assert_search "ap ah", ["ap", "ah"], operator: "or", misspellings: {prefix_length: 2}
  26 + if Searchkick.server_below?("8.0.0")
  27 + assert_search "ap ah", ["ap", "ah"], operator: "or", misspellings: {prefix_length: 2}
  28 + else
  29 + assert_search "ap ah", ["ap", "ah", "api", "apt", "aha"], operator: "or", misspellings: {prefix_length: 2}
  30 + end
23 31 assert_search "api ahi", ["ap", "api", "apt", "ah", "aha"], operator: "or", misspellings: {prefix_length: 2}
24 32 end
25 33  
... ...