Sha256: 544a86f884cd9fd3fb211949754586e98f8812c56fcde8f0b8c5c3ff2aaa4151

Contents?: true

Size: 933 Bytes

Versions: 6

Compression:

Stored size: 933 Bytes

Contents

# frozen_string_literal: true

RSpec.describe "catalog/_paginate_compact.html.erb" do
  let(:user) { User.new { |u| u.save(validate: false) } }
  let(:blacklight_config) { Blacklight::Configuration.new }

  before do
    controller.request.path_parameters[:action] = 'index'
    allow(controller).to receive(:blacklight_config).and_return(blacklight_config)
  end

  it "renders paginatable arrays" do
    render partial: 'catalog/paginate_compact', object: Kaminari.paginate_array([], total_count: 145).page(1).per(10)
    expect(rendered).to have_selector ".page-entries"
    expect(rendered).to have_selector "a[@rel=next]"
  end

  it "renders ActiveRecord collections" do
    50.times { b = Bookmark.new; b.user = user; b.save! }
    render partial: 'catalog/paginate_compact', object: Bookmark.page(1).per(25)
    expect(rendered).to have_selector ".page-entries"
    expect(rendered).to have_selector "a[@rel=next]"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
blacklight-7.40.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-7.39.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.2.2 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.2.1 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.2.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb
blacklight-8.1.0 spec/views/catalog/_paginate_compact.html.erb_spec.rb