Skip to content

Commit

Permalink
removed faulty PAGY_REMATCH variable function; added rematch_all rake…
Browse files Browse the repository at this point in the history
… task
  • Loading branch information
ddnexus committed May 12, 2021
1 parent 4c0de13 commit 789773b
Show file tree
Hide file tree
Showing 16 changed files with 749 additions and 744 deletions.
7 changes: 7 additions & 0 deletions tasks/rematch_all.rake
Original file line number Diff line number Diff line change
@@ -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
140 changes: 70 additions & 70 deletions test/pagy/extras/bootstrap_test.rb.yml

Large diffs are not rendered by default.

214 changes: 107 additions & 107 deletions test/pagy/extras/bulma_test.rb.yml

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions test/pagy/extras/elasticsearch_rails_test.rb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
204 changes: 102 additions & 102 deletions test/pagy/extras/foundation_test.rb.yml

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions test/pagy/extras/headers_test.rb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://example.com:8080/foo?page=1>; rel="first", <https://example.com:8080/foo?page=2>;
rel="prev", <https://example.com:8080/foo?page=4>; rel="next", <https://example.com:8080/foo?page=50>;
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: <https://example.com:8080/foo?page=1>; rel="first", <https://example.com:8080/foo?page=2>;
rel="prev", <https://example.com:8080/foo?page=4>; rel="next"
Expand All @@ -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: <https://example.com:8080/foo?page=1>; rel="first", <https://example.com:8080/foo?page=49>;
rel="prev", <https://example.com:8080/foo?page=50>; rel="last"
Current-Page: '50'
pagy/extras/headers::#pagy_headers#test_0004_omit prev on first page 1:
Link: <https://example.com:8080/foo?page=1>; rel="first", <https://example.com:8080/foo?page=2>;
rel="next", <https://example.com:8080/foo?page=50>; 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: <https://example.com:8080/foo?page=1>; rel="first", <https://example.com:8080/foo?page=2>;
rel="next", <https://example.com:8080/foo?page=50>; rel="last"
Current-Page: '1'
rel="prev", <https://example.com:8080/foo?page=4>; rel="next", <https://example.com:8080/foo?page=50>;
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: <https://example.com:8080/foo?page=1>; rel="first", <https://example.com:8080/foo?page=49>;
rel="prev", <https://example.com:8080/foo?page=50>; 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'
Expand Down
16 changes: 8 additions & 8 deletions test/pagy/extras/items_trim_test.rb.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
---
pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 1: '<a
href="/foo?page=__pagy_page__&items=20" style="display: none;"></a>'
pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 2: '<a
href="/foo?p=__pagy_page__&items=20" style="display: none;"></a>'
pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 3: '<a
href="/foo?page=__pagy_page__&i=20" style="display: none;"></a>'
pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 4: '<a
href="/foo?p=__pagy_page__&i=20" style="display: none;"></a>'
pagy/extras/items_trim#test_0001_renders items selector with trim 1: '<span id="test-id"
class="pagy-items-selector-js" data-pagy-json="[&quot;items_selector&quot;,41,&quot;<a
href=\&quot;/foo?page=__pagy_page__&items=__pagy_items__\&quot; style=\&quot;display:
Expand All @@ -25,3 +17,11 @@ pagy/extras/items_trim#test_0001_renders items selector with trim 3: '<span id="
none;\&quot;></a>&quot;,&quot;page&quot;]"><label>Show <input type="number" min="1"
max="100" value="20" style="padding: 0; text-align: center; width: 3rem;"> products
per page</label></span>'
pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 1: '<a
href="/foo?page=__pagy_page__&items=20" style="display: none;"></a>'
pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 2: '<a
href="/foo?p=__pagy_page__&items=20" style="display: none;"></a>'
pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 3: '<a
href="/foo?page=__pagy_page__&i=20" style="display: none;"></a>'
pagy/extras/items_trim::#pagy_marked_link#test_0001_should return the marked link 4: '<a
href="/foo?p=__pagy_page__&i=20" style="display: none;"></a>'
Loading

0 comments on commit 789773b

Please sign in to comment.