Sha256: e03ff7353677950784de73cb02fdef1ab63026239f7b5ba8a830de708b80ca93

Contents?: true

Size: 1.02 KB

Versions: 62

Compression:

Stored size: 1.02 KB

Contents

require 'test_helper'

module Workarea
  module Navigation
    class SearchResultsTest < TestCase
      def test_gid_finding
        one = SearchResults.new(q: 'baz', foo: 'bar')
        two = SearchResults.new(foo: 'bar', q: 'baz')

        assert_equal(one.to_gid.find.params, one.params)
        assert_equal(one.to_gid.find.params, one.params)
        assert_equal(one.to_gid.find, two)
      end

      def test_sanitizing_params
        Workarea.with_config do |config|
          config.exclude_from_search_results_breadcrumbs = %i(foo)
          results = SearchResults.new(q: 'baz', foo: 'bar')
          assert_equal({ q: 'baz' }.with_indifferent_access, results.params)
        end
      end

      def test_taxon_construction
        results = SearchResults.new(q: 'baz', foo: 'bar')
        assert_equal(Taxon.root, results.taxon.parent)
        assert_equal(Taxon.root.id, results.taxon.parent_id)
        assert_equal(results, results.taxon.navigable)
        assert(results.taxon.name.include?('baz'))
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.5.26 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.4.45 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.5.25 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.5.23 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.4.44 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.5.22 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.4.43 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.5.21 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.4.42 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.5.20 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.4.41 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.5.19 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.4.40 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.5.18 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.4.39 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.5.17 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.4.38 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.5.16 test/models/workarea/navigation/search_results_test.rb
workarea-core-3.4.37 test/models/workarea/navigation/search_results_test.rb