Commit 62892244f925011ccf12313a81e9d63d0a515cf5
1 parent
6fe7e607
Exists in
master
and in
17 other branches
Fixed deprecation warnings in tests [skip ci]
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
test/aggs_test.rb
... | ... | @@ -20,7 +20,8 @@ class AggsTest < Minitest::Test |
20 | 20 | end |
21 | 21 | |
22 | 22 | def test_order |
23 | - agg = Product.search("Product", aggs: {color: {order: {"_term" => "desc"}}}).aggs["color"] | |
23 | + order_key = Searchkick.server_below?("6.0") ? "_term" : "_key" | |
24 | + agg = Product.search("Product", aggs: {color: {order: {order_key => "desc"}}}).aggs["color"] | |
24 | 25 | assert_equal %w(red green blue), agg["buckets"].map { |b| b["key"] } |
25 | 26 | end |
26 | 27 | ... | ... |