From 28338bd35244275e3cd8555fd4c0f134527f0e56 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 17 Mar 2020 23:31:04 -0700 Subject: [PATCH] More fixes --- lib/searchkick/relation.rb | 2 +- test/index_test.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/searchkick/relation.rb b/lib/searchkick/relation.rb index 3994014..0350228 100644 --- a/lib/searchkick/relation.rb +++ b/lib/searchkick/relation.rb @@ -9,7 +9,7 @@ module Searchkick :took, :error, :model_name, :entry_name, :total_count, :total_entries, :current_page, :per_page, :limit_value, :total_pages, :num_pages, :offset_value, :previous_page, :prev_page, :next_page, :first_page?, :last_page?, - :out_of_range?, :hits, :response, :to_a, :first, :highlights, :group_by + :out_of_range?, :hits, :response, :to_a, :first, :highlights, :group_by, :misspellings?, :with_highlights def_delegators :query, :body, :params diff --git a/test/index_test.rb b/test/index_test.rb index 33421c5..1b9240e 100644 --- a/test/index_test.rb +++ b/test/index_test.rb @@ -96,7 +96,7 @@ class IndexTest < Minitest::Test def test_bad_mapping Product.searchkick_index.delete store_names ["Product A"] - error = assert_raises(Searchkick::InvalidQueryError) { Product.search "test" } + error = assert_raises(Searchkick::InvalidQueryError) { Product.search("test").to_a } assert_equal "Bad mapping - run Product.reindex", error.message ensure Product.reindex @@ -111,18 +111,18 @@ class IndexTest < Minitest::Test end def test_missing_index - assert_raises(Searchkick::MissingIndexError) { Product.search("test", index_name: "not_found") } + assert_raises(Searchkick::MissingIndexError) { Product.search("test", index_name: "not_found").to_a } end def test_unsupported_version raises_exception = ->(_) { raise Elasticsearch::Transport::Transport::Error, "[500] No query registered for [multi_match]" } Searchkick.client.stub :search, raises_exception do - assert_raises(Searchkick::UnsupportedVersionError) { Product.search("test") } + assert_raises(Searchkick::UnsupportedVersionError) { Product.search("test").to_a } end end def test_invalid_body - assert_raises(Searchkick::InvalidQueryError) { Product.search(body: {boom: true}) } + assert_raises(Searchkick::InvalidQueryError) { Product.search(body: {boom: true}).to_a } end def test_transaction -- libgit2 0.21.0