Sha256: 0d58cd801fa649db427ce63ed12d24ebd2f6cfe249a87892919f285f35e079dc

Contents?: true

Size: 663 Bytes

Versions: 44

Compression:

Stored size: 663 Bytes

Contents

# frozen_string_literal: true

shared_examples "a paginated resource" do
  let(:collection_size) { 30 }

  before do
    visit_component
  end

  it "lists 20 resources per page by default" do
    expect(page).to have_css(resource_selector, count: 20)
    expect(page).to have_css(".pagination .page", count: 2)
  end

  it "results per page can be changed from the selector" do
    expect(page).to have_css(".results-per-page")

    within ".results-per-page" do
      page.find("a", text: "20").click
      click_link "50"
    end

    expect(page).to have_css(resource_selector, count: collection_size)
    expect(page).to have_no_css(".pagination")
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
decidim-core-0.11.2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.12.0.pre lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.11.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.11.0.pre1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb