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-0.28.1 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.28.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.27.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.26.1 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.26.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.25.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.24.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.23.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.22.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.21.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.20.3 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.20.2 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.20.1 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.20.0 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.19.2 spec/helpers/spotlight/search_configurations_helper_spec.rb
blacklight-spotlight-0.19.1 spec/helpers/spotlight/search_configurations_helper_spec.rb