Sha256: 3a231ebbf0257fa726e61dd82afb6a31e278e4245197742e8c8cd9f639fef7ea
Contents?: true
Size: 712 Bytes
Versions: 28
Compression:
Stored size: 712 Bytes
Contents
require 'test_helper' module Workarea module Recommendation class SearchesTest < TestCase def test_find Metrics::User.create!(viewed: { search_ids: %w(foo bar) }) Metrics::User.create!(viewed: { search_ids: %w(foo) }) 2.times { Metrics::User.create!(viewed: { search_ids: %w(foo baz) }) } ProcessSearchRecommendations.new.perform assert_equal([], Searches.find('!#@$%')) assert_equal([], Searches.find('fooed')) Metrics::SearchByWeek.create!(query_id: 'baz', query_string: 'baz', orders: 1) Metrics::SearchByWeek.create!(query_id: 'bar', orders: 2) assert_equal(%w(baz), Searches.find('fooed')) end end end end
Version data entries
28 entries across 28 versions & 1 rubygems