Sha256: 074d64f9511ae32fbd44b7542b7193d6fa27a449d2eb8dd3bd43a28b2188f75e
Contents?: true
Size: 1.11 KB
Versions: 95
Compression:
Stored size: 1.11 KB
Contents
# frozen_string_literal: true RSpec.describe "catalog/_sort_widget" do let(:blacklight_config) { Blacklight::Configuration.new } let(:response) { instance_double(Blacklight::Solr::Response, empty?: false, sort: 'one') } before do allow(view).to receive_messages(blacklight_config: blacklight_config) assign(:response, response) controller.request.path_parameters[:action] = 'index' end context 'with no sort fields configured' do it 'renders nothing' do render expect(rendered).to be_blank end end context 'with a single sort field configured' do before do blacklight_config.add_sort_field 'one' end it 'renders nothing' do render expect(rendered).to be_blank end end context 'with multiple sort fields configured' do before do blacklight_config.add_sort_field 'one' blacklight_config.add_sort_field 'two' end it 'renders a dropdown with the various options' do render expect(rendered).to have_button 'One' expect(rendered).to have_link 'One' expect(rendered).to have_link 'Two' end end end
Version data entries
95 entries across 94 versions & 2 rubygems