Sha256: f44a492ada34c4d548ad015a4a56fa50d8c27390ca5e40ff1cf9fad67a8debc2
Contents?: true
Size: 1.29 KB
Versions: 1
Compression:
Stored size: 1.29 KB
Contents
# frozen_string_literal: true RSpec.describe 'catalog/_facet_index_navigation.html.erb', type: :view do let(:pagination) { Blacklight::Solr::FacetPaginator.new([]) } let(:facet) { Blacklight::Configuration::FacetField.new(index_range: '0'..'9') } let(:blacklight_config) { Blacklight::Configuration.new } before do assign(:pagination, pagination) assign(:facet, facet) allow(view).to receive(:blacklight_config).and_return(blacklight_config) controller.request.path_parameters[:action] = 'index' end it 'renders the facet index navigation range' do render expect(rendered).to have_selector '.pagination' expect(rendered).to have_link '0', href: '/?facet.prefix=0&facet.sort=index' expect(rendered).to have_link '1' expect(rendered).to have_link '8' expect(rendered).to have_link '9' end it 'renders an "all" button' do render expect(rendered).to have_selector '.page-link', text: 'All' end context 'with a selected index' do let(:pagination) { Blacklight::Solr::FacetPaginator.new([], prefix: '5') } it 'highlights the selected index' do render expect(rendered).to have_selector '.active', text: '5' end it 'enables the clear facets button' do render expect(rendered).to have_link 'All' end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
blacklight-7.11.1 | spec/views/catalog/_facet_index_navigation.html.erb_spec.rb |