Sha256: 8239a486b399c72ec28b4c1cb393923734f9a6e1fe3974af3dc09bf17926f536

Contents?: true

Size: 735 Bytes

Versions: 56

Compression:

Stored size: 735 Bytes

Contents

describe Spotlight::SearchConfigurationsHelper, type: :helper do
  describe '#translate_sort_fields' do
    let(:sort_config) do
      Blacklight::OpenStructWithHashAccess.new(sort: 'score asc, sort_title_ssi desc')
    end

    it 'translates sort fields' do
      expect(translate_sort_fields(sort_config)).to eq 'relevancy score ascending and title descending'
    end

    it 'humanizes untranslatable sort fields' do
      sort_config.sort = 'some_other_field desc'
      expect(translate_sort_fields(sort_config)).to eq 'some other field descending'
    end

    it 'supports explicit sort descriptions' do
      sort_config.sort_description = 'xyz'
      expect(translate_sort_fields(sort_config)).to eq 'xyz'
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
blacklight-spotlight-2.4.1 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.4.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.3.3 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.3.2 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.3.1 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.3.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.2.1 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.2.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.1.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.0.2 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.0.1 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.0.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.0.0.rc6 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.0.0.rc5 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.0.0.rc4 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.0.0.rc3 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.0.0.rc2 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-2.0.0.rc1 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-1.5.1 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-1.4.1 spec/helpers/spotlight/search_configurations_helper_spec.rb