Sha256: 8826bbc4617011e6c7565880a99a582cf327532c95d58d25c405d236f2013a8d

Contents?: true

Size: 715 Bytes

Versions: 10

Compression:

Stored size: 715 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][:_default_][:_routing], required: true
  end

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

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

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
searchkick-2.3.1 test/routing_test.rb
searchkick-hooopo-2.3.3 test/routing_test.rb
searchkick-hooopo-2.3.2 test/routing_test.rb
searchkick-hooopo-2.3.1 test/routing_test.rb
searchkick-hooopo-2.3.0 test/routing_test.rb
searchkick-2.3.0 test/routing_test.rb
searchkick-2.2.1 test/routing_test.rb
searchkick-2.2.0 test/routing_test.rb
searchkick-2.1.1 test/routing_test.rb
searchkick-2.1.0 test/routing_test.rb