diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-08-14 17:04:43 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-08-14 17:04:43 +0300 |
commit | 12cdc4616df600edef92f417aecce217f2e5326d (patch) | |
tree | 652bb9486fd15685f694c6529d90fe02428d87a9 /spec | |
parent | 75130bbe52f869a1520959d09997bf438d3fc6e3 (diff) | |
parent | c1f9403e45e636651010929b6113add34f8e6a8a (diff) |
Merge branch 'pagination-projects-explore' into 'master'
Use Prev/Next pagination for exploring projects
Closes #27390
See merge request !13456
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/pagination_helper_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/helpers/pagination_helper_spec.rb b/spec/helpers/pagination_helper_spec.rb new file mode 100644 index 00000000000..e235475fb47 --- /dev/null +++ b/spec/helpers/pagination_helper_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +describe PaginationHelper do + describe '#paginate_collection' do + let(:collection) { User.all.page(1) } + + it 'paginates a collection without using a COUNT' do + without_count = collection.without_count + + expect(helper).to receive(:paginate_without_count) + .with(without_count) + .and_call_original + + helper.paginate_collection(without_count) + end + + it 'paginates a collection using a COUNT' do + expect(helper).to receive(:paginate_with_count).and_call_original + + helper.paginate_collection(collection) + end + end +end |