Commit 28338bd35244275e3cd8555fd4c0f134527f0e56
1 parent
643becc6
Exists in
relation
and in
1 other branch
More fixes
Showing
2 changed files
with
5 additions
and
5 deletions
Show diff stats
lib/searchkick/relation.rb
... | ... | @@ -9,7 +9,7 @@ module Searchkick |
9 | 9 | :took, :error, :model_name, :entry_name, :total_count, :total_entries, |
10 | 10 | :current_page, :per_page, :limit_value, :total_pages, :num_pages, |
11 | 11 | :offset_value, :previous_page, :prev_page, :next_page, :first_page?, :last_page?, |
12 | - :out_of_range?, :hits, :response, :to_a, :first, :highlights, :group_by | |
12 | + :out_of_range?, :hits, :response, :to_a, :first, :highlights, :group_by, :misspellings?, :with_highlights | |
13 | 13 | |
14 | 14 | def_delegators :query, :body, :params |
15 | 15 | ... | ... |
test/index_test.rb
... | ... | @@ -96,7 +96,7 @@ class IndexTest < Minitest::Test |
96 | 96 | def test_bad_mapping |
97 | 97 | Product.searchkick_index.delete |
98 | 98 | store_names ["Product A"] |
99 | - error = assert_raises(Searchkick::InvalidQueryError) { Product.search "test" } | |
99 | + error = assert_raises(Searchkick::InvalidQueryError) { Product.search("test").to_a } | |
100 | 100 | assert_equal "Bad mapping - run Product.reindex", error.message |
101 | 101 | ensure |
102 | 102 | Product.reindex |
... | ... | @@ -111,18 +111,18 @@ class IndexTest < Minitest::Test |
111 | 111 | end |
112 | 112 | |
113 | 113 | def test_missing_index |
114 | - assert_raises(Searchkick::MissingIndexError) { Product.search("test", index_name: "not_found") } | |
114 | + assert_raises(Searchkick::MissingIndexError) { Product.search("test", index_name: "not_found").to_a } | |
115 | 115 | end |
116 | 116 | |
117 | 117 | def test_unsupported_version |
118 | 118 | raises_exception = ->(_) { raise Elasticsearch::Transport::Transport::Error, "[500] No query registered for [multi_match]" } |
119 | 119 | Searchkick.client.stub :search, raises_exception do |
120 | - assert_raises(Searchkick::UnsupportedVersionError) { Product.search("test") } | |
120 | + assert_raises(Searchkick::UnsupportedVersionError) { Product.search("test").to_a } | |
121 | 121 | end |
122 | 122 | end |
123 | 123 | |
124 | 124 | def test_invalid_body |
125 | - assert_raises(Searchkick::InvalidQueryError) { Product.search(body: {boom: true}) } | |
125 | + assert_raises(Searchkick::InvalidQueryError) { Product.search(body: {boom: true}).to_a } | |
126 | 126 | end |
127 | 127 | |
128 | 128 | def test_transaction | ... | ... |