Sha256: ca44313490eca2bc995acf1bd5c45c32f0d461d55526e239fabbf5fce305ab76

Contents?: true

Size: 997 Bytes

Versions: 5

Compression:

Stored size: 997 Bytes

Contents

require 'spec_helper'

describe 'catalog/_sort_and_per_page.html.erb' do
  before do
    allow(controller).to receive(:current_user).and_return(stub_model(User))
    allow_any_instance_of(Ability).to receive(:can?).and_return(true)
    @resp = ["a","b","c"]
    assign(:response, @resp )
    allow(@resp).to receive(:total_count).and_return(20)
    allow(@resp).to receive(:limit_value).and_return(3)
    allow(@resp).to receive(:rows).and_return(3)
    allow(@resp).to receive(:offset_value).and_return(3)
    allow(@resp).to receive(:current_page).and_return(2)
    allow(@resp).to receive(:total_pages).and_return(7)
    allow(view).to receive(:blacklight_config).and_return(CatalogController.blacklight_config)
  end



  it 'appears on page without error' do
    render
    page = Capybara::Node::Simple.new(rendered)
    expect(page).to have_selector('span.page_entries', count: 1)
    expect(rendered).to include("<strong>4</strong> - <strong>6</strong> of <strong>20</strong>")
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sufia-4.0.1 spec/views/catalog/sort_and_per_page.html.erb_spec.rb
sufia-4.0.0 spec/views/catalog/sort_and_per_page.html.erb_spec.rb
sufia-4.0.0.rc2 spec/views/catalog/sort_and_per_page.html.erb_spec.rb
sufia-4.0.0.rc1 spec/views/catalog/sort_and_per_pange.html.erb_spec.rb
sufia-4.0.0.beta4 spec/views/catalog/sort_and_per_pange.html.erb_spec.rb