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

Version Path
workarea-core-3.5.27 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.26 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.25 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.23 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.22 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.21 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.20 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.19 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.18 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.17 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.16 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.15 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.14 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.13 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.12 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.11 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.10 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.9 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.8 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.5.7 test/queries/workarea/recommendation/searches_test.rb