Sha256: 46ace7fe4d612af343677e6267d0bf9d7c00f14e8073ad433a4dd512216c347d

Contents?: true

Size: 722 Bytes

Versions: 34

Compression:

Stored size: 722 Bytes

Contents

require 'test_helper'

module Workarea
  module Recommendation
    class SearchesTest < TestCase
      def test_find
        Recommendation::UserActivity.create!(searches: %w(foo bars))
        Recommendation::UserActivity.create!(searches: %w(foo @#$%))
        2.times { Recommendation::UserActivity.create!(searches: %w(foos 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

34 entries across 34 versions & 1 rubygems

Version Path
workarea-core-3.4.45 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.44 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.43 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.42 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.41 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.40 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.39 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.38 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.37 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.36 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.35 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.34 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.33 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.32 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.31 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.30 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.29 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.28 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.27 test/queries/workarea/recommendation/searches_test.rb
workarea-core-3.4.26 test/queries/workarea/recommendation/searches_test.rb