diff --git a/tasks/rematch_all.rake b/tasks/rematch_all.rake new file mode 100644 index 000000000..fc36bd939 --- /dev/null +++ b/tasks/rematch_all.rake @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +desc 'Rematch all the tests with their new values' +task :rematch_all do + FileList.new('test/**/*_test.rb.yml').each { |f| File.delete(f) } + Rake::Task['test'].invoke +end diff --git a/test/pagy/extras/bootstrap_test.rb.yml b/test/pagy/extras/bootstrap_test.rb.yml index 1e1d025aa..098f839ee 100644 --- a/test/pagy/extras/bootstrap_test.rb.yml +++ b/test/pagy/extras/bootstrap_test.rb.yml @@ -1,4 +1,21 @@ --- +pagy/extras/bootstrap::#pagy_bootstrap_combo_nav_js#test_0001_renders first page 1: '' +pagy/extras/bootstrap::#pagy_bootstrap_combo_nav_js#test_0001_renders first page 2: '' pagy/extras/bootstrap::#pagy_bootstrap_combo_nav_js#test_0002_renders intermediate page 1: '' -pagy/extras/bootstrap::#pagy_bootstrap_combo_nav_js#test_0001_renders first page 1: '' -pagy/extras/bootstrap::#pagy_bootstrap_combo_nav_js#test_0001_renders first page 2: '' pagy/extras/bootstrap::#pagy_bootstrap_combo_nav_js#test_0003_renders last page 1: '' -pagy/extras/bootstrap::#pagy_bootstrap_nav_js#test_0001_renders first page 1: -pagy/extras/bootstrap::#pagy_bootstrap_nav_js#test_0001_renders first page 2: pagy/extras/bootstrap::#pagy_bootstrap_nav_js#test_0003_renders last page 1: +pagy/extras/bootstrap::#pagy_bootstrap_nav_js#test_0001_renders first page 1: +pagy/extras/bootstrap::#pagy_bootstrap_nav_js#test_0001_renders first page 2: pagy/extras/bootstrap::#pagy_bootstrap_nav_js#test_0002_renders intermediate page 1: +pagy/extras/bootstrap::#pagy_bootstrap_nav#test_0002_renders intermediate page 1: +pagy/extras/bootstrap::#pagy_bootstrap_nav#test_0002_renders intermediate page 2: pagy/extras/bootstrap::#pagy_bootstrap_nav#test_0003_renders last page 1: -pagy/extras/bootstrap::#pagy_bootstrap_nav#test_0002_renders intermediate page 1: -pagy/extras/bootstrap::#pagy_bootstrap_nav#test_0002_renders intermediate page 2: diff --git a/test/pagy/extras/bulma_test.rb.yml b/test/pagy/extras/bulma_test.rb.yml index 3b55e7501..e87754c7d 100644 --- a/test/pagy/extras/bulma_test.rb.yml +++ b/test/pagy/extras/bulma_test.rb.yml @@ -1,22 +1,4 @@ --- -pagy/extras/bulma::#pagy_bulma_combo_nav_js#test_0001_renders first page 1: '' -pagy/extras/bulma::#pagy_bulma_combo_nav_js#test_0001_renders first page 2: '' pagy/extras/bulma::#pagy_bulma_combo_nav_js#test_0002_renders intermediate page 1: '' -pagy/extras/bulma::#pagy_bulma_nav#test_0001_renders first page 1: -pagy/extras/bulma::#pagy_bulma_nav#test_0001_renders first page 2: -pagy/extras/bulma::#pagy_bulma_nav#test_0002_renders intermediate page 1: -pagy/extras/bulma::#pagy_bulma_nav#test_0002_renders intermediate page 2: -pagy/extras/bulma::#pagy_bulma_nav#test_0003_renders last page 1: -pagy/extras/bulma::#pagy_bulma_nav#test_0003_renders last page 2: +pagy/extras/bulma::#pagy_bulma_combo_nav_js#test_0001_renders first page 1: '' +pagy/extras/bulma::#pagy_bulma_combo_nav_js#test_0001_renders first page 2: '' pagy/extras/bulma::#pagy_bulma_nav_js#test_0001_renders first page 1: -pagy/extras/bulma::#pagy_bulma_nav_js#test_0002_renders intermediate page 1: -pagy/extras/bulma::#pagy_bulma_nav_js#test_0002_renders intermediate page 2: +pagy/extras/bulma::#pagy_bulma_nav_js#test_0004_renders with :steps 2: -pagy/extras/bulma::#pagy_bulma_nav_js#test_0004_renders with :steps 1: -pagy/extras/bulma::#pagy_bulma_nav_js#test_0004_renders with :steps 2: +pagy/extras/bulma::#pagy_bulma_nav_js#test_0002_renders intermediate page 2: +pagy/extras/bulma::#pagy_bulma_nav#test_0003_renders last page 1: +pagy/extras/bulma::#pagy_bulma_nav#test_0003_renders last page 2: +pagy/extras/bulma::#pagy_bulma_nav#test_0001_renders first page 1: +pagy/extras/bulma::#pagy_bulma_nav#test_0001_renders first page 2: +pagy/extras/bulma::#pagy_bulma_nav#test_0002_renders intermediate page 1: +pagy/extras/bulma::#pagy_bulma_nav#test_0002_renders intermediate page 2: diff --git a/test/pagy/extras/elasticsearch_rails_test.rb.yml b/test/pagy/extras/elasticsearch_rails_test.rb.yml index dbdd6b52b..b1d792ce3 100644 --- a/test/pagy/extras/elasticsearch_rails_test.rb.yml +++ b/test/pagy/extras/elasticsearch_rails_test.rb.yml @@ -63,18 +63,7 @@ pagy/extras/elasticsearch_rails::controller_methods::#pagy_elasticsearch_rails#t - R-b-998 - R-b-999 - R-b-1000 -pagy/extras/elasticsearch_rails::controller_methods::#pagy_elasticsearch7_rails#test_0004_paginates with overflow 1: -- R-b-991 -- R-b-992 -- R-b-993 -- R-b-994 -- R-b-995 -- R-b-996 -- R-b-997 -- R-b-998 -- R-b-999 -- R-b-1000 -pagy/extras/elasticsearch_rails::controller_methods::#pagy_elasticsearch7_rails#test_0002_paginates records with defaults 1: +pagy/extras/elasticsearch_rails::controller_methods::#pagy_elasticsearch7_rails#test_0001_paginates response with defaults 1: - R-a-41 - R-a-42 - R-a-43 @@ -95,7 +84,18 @@ pagy/extras/elasticsearch_rails::controller_methods::#pagy_elasticsearch7_rails# - R-a-58 - R-a-59 - R-a-60 -pagy/extras/elasticsearch_rails::controller_methods::#pagy_elasticsearch7_rails#test_0001_paginates response with defaults 1: +pagy/extras/elasticsearch_rails::controller_methods::#pagy_elasticsearch7_rails#test_0003_paginates with vars 1: +- R-b-11 +- R-b-12 +- R-b-13 +- R-b-14 +- R-b-15 +- R-b-16 +- R-b-17 +- R-b-18 +- R-b-19 +- R-b-20 +pagy/extras/elasticsearch_rails::controller_methods::#pagy_elasticsearch7_rails#test_0002_paginates records with defaults 1: - R-a-41 - R-a-42 - R-a-43 @@ -116,14 +116,14 @@ pagy/extras/elasticsearch_rails::controller_methods::#pagy_elasticsearch7_rails# - R-a-58 - R-a-59 - R-a-60 -pagy/extras/elasticsearch_rails::controller_methods::#pagy_elasticsearch7_rails#test_0003_paginates with vars 1: -- R-b-11 -- R-b-12 -- R-b-13 -- R-b-14 -- R-b-15 -- R-b-16 -- R-b-17 -- R-b-18 -- R-b-19 -- R-b-20 +pagy/extras/elasticsearch_rails::controller_methods::#pagy_elasticsearch7_rails#test_0004_paginates with overflow 1: +- R-b-991 +- R-b-992 +- R-b-993 +- R-b-994 +- R-b-995 +- R-b-996 +- R-b-997 +- R-b-998 +- R-b-999 +- R-b-1000 diff --git a/test/pagy/extras/foundation_test.rb.yml b/test/pagy/extras/foundation_test.rb.yml index 20dcec9f8..2bc42d50b 100644 --- a/test/pagy/extras/foundation_test.rb.yml +++ b/test/pagy/extras/foundation_test.rb.yml @@ -1,4 +1,54 @@ --- +pagy/extras/foundation::#pagy_foundation_nav#test_0001_renders first page 1: +pagy/extras/foundation::#pagy_foundation_nav#test_0001_renders first page 2: +pagy/extras/foundation::#pagy_foundation_nav#test_0002_renders intermediate page 1: +pagy/extras/foundation::#pagy_foundation_nav#test_0002_renders intermediate page 2: +pagy/extras/foundation::#pagy_foundation_nav#test_0003_renders last page 1: +pagy/extras/foundation::#pagy_foundation_nav#test_0003_renders last page 2: pagy/extras/foundation::#pagy_foundation_combo_nav_js#test_0002_renders intermediate page 1: '' -pagy/extras/foundation::#pagy_foundation_combo_nav_js#test_0001_renders first page 1: '' -pagy/extras/foundation::#pagy_foundation_combo_nav_js#test_0001_renders first page 2: '' pagy/extras/foundation::#pagy_foundation_combo_nav_js#test_0003_renders last page 1: '' -pagy/extras/foundation::#pagy_foundation_nav_js#test_0003_renders last page 1: -pagy/extras/foundation::#pagy_foundation_nav_js#test_0003_renders last page 2: -pagy/extras/foundation::#pagy_foundation_nav_js#test_0001_renders first page 1: -pagy/extras/foundation::#pagy_foundation_nav_js#test_0001_renders first page 2: +pagy/extras/foundation::#pagy_foundation_combo_nav_js#test_0001_renders first page 1: '' +pagy/extras/foundation::#pagy_foundation_combo_nav_js#test_0001_renders first page 2: '' pagy/extras/foundation::#pagy_foundation_nav_js#test_0002_renders intermediate page 1: -pagy/extras/foundation::#pagy_foundation_nav#test_0001_renders first page 1: -pagy/extras/foundation::#pagy_foundation_nav#test_0001_renders first page 2: -pagy/extras/foundation::#pagy_foundation_nav#test_0002_renders intermediate page 1: -pagy/extras/foundation::#pagy_foundation_nav#test_0002_renders intermediate page 2: -pagy/extras/foundation::#pagy_foundation_nav#test_0003_renders last page 1: -pagy/extras/foundation::#pagy_foundation_nav#test_0003_renders last page 2: +pagy/extras/foundation::#pagy_foundation_nav_js#test_0001_renders first page 1: +pagy/extras/foundation::#pagy_foundation_nav_js#test_0001_renders first page 2: +pagy/extras/foundation::#pagy_foundation_nav_js#test_0003_renders last page 1: +pagy/extras/foundation::#pagy_foundation_nav_js#test_0003_renders last page 2: diff --git a/test/pagy/extras/headers_test.rb.yml b/test/pagy/extras/headers_test.rb.yml index 2f0bca16b..700d3c505 100644 --- a/test/pagy/extras/headers_test.rb.yml +++ b/test/pagy/extras/headers_test.rb.yml @@ -17,20 +17,6 @@ pagy/extras/headers::#pagy_headers#test_0001_returns the full headers hash 2: Page-Items: '20' Total-Pages: '50' Total-Count: '1000' -pagy/extras/headers::#pagy_headers#test_0002_returns custom headers hash 1: - Link: ; rel="first", ; - rel="prev", ; rel="next", ; - rel="last" - Per-Page: '20' - Total: '1000' -pagy/extras/headers::#pagy_headers#test_0002_returns custom headers hash 2: - Link: - first: https://example.com:8080/foo?page=1 - prev: https://example.com:8080/foo?page=2 - next: https://example.com:8080/foo?page=4 - last: https://example.com:8080/foo?page=50 - Per-Page: '20' - Total: '1000' pagy/extras/headers::#pagy_headers#test_0003_returns the countless headers hash 1: Link: ; rel="first", ; rel="prev", ; rel="next" @@ -43,35 +29,49 @@ pagy/extras/headers::#pagy_headers#test_0003_returns the countless headers hash next: https://example.com:8080/foo?page=4 Current-Page: '3' Page-Items: '20' -pagy/extras/headers::#pagy_headers#test_0005_omit next on last page 1: - Link: ; rel="first", ; - rel="prev", ; rel="last" - Current-Page: '50' +pagy/extras/headers::#pagy_headers#test_0004_omit prev on first page 1: + Link: ; rel="first", ; + rel="next", ; rel="last" + Current-Page: '1' Page-Items: '20' Total-Pages: '50' Total-Count: '1000' -pagy/extras/headers::#pagy_headers#test_0005_omit next on last page 2: +pagy/extras/headers::#pagy_headers#test_0004_omit prev on first page 2: Link: first: https://example.com:8080/foo?page=1 - prev: https://example.com:8080/foo?page=49 + next: https://example.com:8080/foo?page=2 last: https://example.com:8080/foo?page=50 - Current-Page: '50' + Current-Page: '1' Page-Items: '20' Total-Pages: '50' Total-Count: '1000' -pagy/extras/headers::#pagy_headers#test_0004_omit prev on first page 1: +pagy/extras/headers::#pagy_headers#test_0002_returns custom headers hash 1: Link: ; rel="first", ; - rel="next", ; rel="last" - Current-Page: '1' + rel="prev", ; rel="next", ; + rel="last" + Per-Page: '20' + Total: '1000' +pagy/extras/headers::#pagy_headers#test_0002_returns custom headers hash 2: + Link: + first: https://example.com:8080/foo?page=1 + prev: https://example.com:8080/foo?page=2 + next: https://example.com:8080/foo?page=4 + last: https://example.com:8080/foo?page=50 + Per-Page: '20' + Total: '1000' +pagy/extras/headers::#pagy_headers#test_0005_omit next on last page 1: + Link: ; rel="first", ; + rel="prev", ; rel="last" + Current-Page: '50' Page-Items: '20' Total-Pages: '50' Total-Count: '1000' -pagy/extras/headers::#pagy_headers#test_0004_omit prev on first page 2: +pagy/extras/headers::#pagy_headers#test_0005_omit next on last page 2: Link: first: https://example.com:8080/foo?page=1 - next: https://example.com:8080/foo?page=2 + prev: https://example.com:8080/foo?page=49 last: https://example.com:8080/foo?page=50 - Current-Page: '1' + Current-Page: '50' Page-Items: '20' Total-Pages: '50' Total-Count: '1000' diff --git a/test/pagy/extras/items_trim_test.rb.yml b/test/pagy/extras/items_trim_test.rb.yml index 3e158a02f..e7f1da588 100644 --- a/test/pagy/extras/items_trim_test.rb.yml +++ b/test/pagy/extras/items_trim_test.rb.yml @@ -1,12 +1,4 @@ --- -pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 1: '' -pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 2: '' -pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 3: '' -pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 4: '' pagy/extras/items_trim#test_0001_renders items selector with trim 1: '","page"]">' +pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 1: '' +pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 2: '' +pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 3: '' +pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 4: '' diff --git a/test/pagy/extras/materialize_test.rb.yml b/test/pagy/extras/materialize_test.rb.yml index e3856f90c..8fc56ab94 100644 --- a/test/pagy/extras/materialize_test.rb.yml +++ b/test/pagy/extras/materialize_test.rb.yml @@ -1,28 +1,71 @@ --- -pagy/extras/materialize::#pagy_materialize_combo_nav_js#test_0003_renders last page 1: '