Sha256: 93ae9d00c980fecc504cf0e40301d31d3631ca8556cdd01a7e74b34dba7c6fa3

Contents?: true

Size: 702 Bytes

Versions: 5

Compression:

Stored size: 702 Bytes

Contents

require_relative "test_helper"

class RoutingTest < Minitest::Test
  def test_routing_query
    query = Store.search("Dollar Tree", routing: "Dollar Tree", execute: false)
    assert_equal query.params[:routing], "Dollar Tree"
  end

  def test_routing_mappings
    index_options = Store.searchkick_index.index_options
    assert_equal index_options[:mappings]["store"][:_routing], required: true
  end

  def test_routing_correct_node
    store_names ["Dollar Tree"], Store
    assert_search "*", ["Dollar Tree"], {routing: "Dollar Tree"}, Store
  end

  def test_routing_incorrect_node
    store_names ["Dollar Tree"], Store
    assert_search "*", ["Dollar Tree"], {routing: "Boom"}, Store
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
searchkick-3.0.3 test/routing_test.rb
searchkick_evichat-0.0.2 test/routing_test.rb
searchkick-3.0.2 test/routing_test.rb
searchkick-3.0.1 test/routing_test.rb
searchkick-3.0.0 test/routing_test.rb