Sha256: 0eb814a763d611fa3d4dd71e1bea203fea260077f210712c1944c177d4958023
Contents?: true
Size: 766 Bytes
Versions: 40
Compression:
Stored size: 766 Bytes
Contents
# frozen_string_literal: true 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
40 entries across 40 versions & 1 rubygems