Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pagination_helper_spec.rb « helpers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e235475fb47c2ea15ee75f47eed79d1939ee95e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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