Sha256: f2c9f67b348cce8919834d0fd0beb225ae566b267538369d54622b7b32b8db05
Contents?: true
Size: 1.09 KB
Versions: 48
Compression:
Stored size: 1.09 KB
Contents
# frozen_string_literal: true require 'spec_helper' RSpec.describe Blacklight::ClausePresenter, type: :presenter do subject(:presenter) do described_class.new('0', params.with_indifferent_access.dig(:clause, '0'), field_config, controller.view_context, search_state) end let(:field_config) { Blacklight::Configuration::NullField.new key: 'some_field' } let(:search_state) { Blacklight::SearchState.new(params.with_indifferent_access, Blacklight::Configuration.new) } let(:params) { {} } describe '#field_label' do it 'returns a label for the field' do expect(subject.field_label).to eq 'Some Field' end end describe '#label' do let(:params) { { clause: { '0' => { query: 'some search string' } } } } it 'returns the query value for the clause' do expect(subject.label).to eq 'some search string' end end describe '#remove_href' do let(:params) { { clause: { '0' => { query: 'some_search_string' } } } } it 'returns the href to remove the search clause' do expect(subject.remove_href).not_to include 'some_search_string' end end end
Version data entries
48 entries across 48 versions & 2 rubygems