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

pagination_spec.rb « helpers « api « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ae6af5b540ee165045372477080a58d95901cb51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

require 'fast_spec_helper'

RSpec.describe API::Helpers::Pagination do
  subject { Class.new.include(described_class).new }

  let(:paginator) { double('paginator') }
  let(:relation) { double('relation') }
  let(:expected_result) { double('expected result') }

  it 'delegates to OffsetPagination' do
    expect(Gitlab::Pagination::OffsetPagination).to receive(:new).with(subject).and_return(paginator)
    expect(paginator).to receive(:paginate).with(relation).and_return(expected_result)

    expect(subject.paginate(relation)).to eq(expected_result)
  end
end