Sha256: beb0a6f0b8e8adba8fd784c13512c0d8cc3749a781bf0d6cc768fda0e11d1b07

Contents?: true

Size: 773 Bytes

Versions: 5

Compression:

Stored size: 773 Bytes

Contents

# frozen_string_literal: true

shared_examples "a paginated collection" do |options|
  before do
    # Current path strips out the request parameters, use current_url when needed
    # Be aware that current_utl can lead to flaky, use with caution
    if options&.dig(:url)
      visit current_url
    else
      visit current_path
    end
  end

  describe "Number of results per page" do
    it "lists 15 resources per page by default" do
      expect(page).to have_css(".table-list tbody tr", count: 15)
    end

    it "changes the number of results per page" do
      within "[data-pagination]" do
        page.find("details", text: "15").click
        click_link "50"
      end

      expect(page).to have_selector(".table-list tbody tr", count: 50)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decidim-admin-0.28.2 lib/decidim/admin/test/manage_paginated_collection_examples.rb
decidim-admin-0.28.1 lib/decidim/admin/test/manage_paginated_collection_examples.rb
decidim-admin-0.28.0 lib/decidim/admin/test/manage_paginated_collection_examples.rb
decidim-admin-0.28.0.rc5 lib/decidim/admin/test/manage_paginated_collection_examples.rb
decidim-admin-0.28.0.rc4 lib/decidim/admin/test/manage_paginated_collection_examples.rb