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

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

require 'spec_helper'

RSpec.describe Gitlab::Graphql::Pagination::OffsetActiveRecordRelationConnection do
  it 'subclasses from GraphQL::Relay::RelationConnection' do
    expect(described_class.superclass).to eq GraphQL::Pagination::ActiveRecordRelationConnection
  end

  it_behaves_like 'a connection with collection methods' do
    let(:connection) { described_class.new(Project.all) }
  end

  it_behaves_like 'a redactable connection' do
    let_it_be(:users) { create_list(:user, 2) }

    let(:connection) { described_class.new(User.all, max_page_size: 10) }
    let(:unwanted) { users.second }
  end
end