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.24.3 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.23.6 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.24.2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.23.5 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.24.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.24.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.24.0.rc2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.23.4 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.24.0.rc1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.23.3 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.23.2 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.23.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.23.1.rc1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.23.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.22.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.21.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.20.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.20.0 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.19.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb
decidim-core-0.18.1 lib/decidim/core/test/shared_examples/paginated_resource_examples.rb