Sha256: 2997371c1d874d0d3b8a5426038b6b2aeae5758d250f3c16ca3ea9d0932492a0
Contents?: true
Size: 928 Bytes
Versions: 34
Compression:
Stored size: 928 Bytes
Contents
require 'test_helper' module Workarea module Search class SearchSuggestionsTest < TestCase include SearchIndexing def test_results Metrics::SearchByDay.save_search('test', 1) 2.times { Metrics::SearchByDay.save_search('test product', 2) } travel_to 1.week.from_now GenerateInsights.generate_all! BulkIndexSearches.perform create_product(name: 'test product 1') create_product(name: 'test product 2', active: false) BulkIndexProducts.perform results = SearchSuggestions.new(q: 'tes').results assert_equal(3, results.length) refute_nil(results.detect { |r| r['_source']['content']['name'] == 'test product' }) refute_nil(results.detect { |r| r['_source']['content']['name'] == 'test' }) refute_nil(results.detect { |r| r['_source']['content']['name'] == 'test product 1' }) end end end end
Version data entries
34 entries across 34 versions & 1 rubygems