diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-02 15:07:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-02 15:07:57 +0300 |
commit | 988b28ec1a379d38f6ac9ed04886ee564fd447fd (patch) | |
tree | 9d93267209387e62d23ea7abf81ef9c0d64f2f0b /spec/graphql | |
parent | a325f3a104748ecc68df7c3d793940aa709a111f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql')
-rw-r--r-- | spec/graphql/gitlab_schema_spec.rb | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/spec/graphql/gitlab_schema_spec.rb b/spec/graphql/gitlab_schema_spec.rb index 2ec477fc494..d0eb0475879 100644 --- a/spec/graphql/gitlab_schema_spec.rb +++ b/spec/graphql/gitlab_schema_spec.rb @@ -3,6 +3,7 @@ require 'spec_helper' describe GitlabSchema do + let_it_be(:implementations) { GraphQL::Relay::BaseConnection::CONNECTION_IMPLEMENTATIONS } let(:user) { build :user } it 'uses batch loading' do @@ -33,12 +34,30 @@ describe GitlabSchema do expect(described_class.query).to eq(::Types::QueryType.to_graphql) end - it 'paginates active record relations using `Gitlab::Graphql::Connections::KeysetConnection`' do - connection = GraphQL::Relay::BaseConnection::CONNECTION_IMPLEMENTATIONS[ActiveRecord::Relation.name] + it 'paginates active record relations using `Connections::Keyset::Connection`' do + connection = implementations[ActiveRecord::Relation.name] expect(connection).to eq(Gitlab::Graphql::Connections::Keyset::Connection) end + it 'paginates ExternallyPaginatedArray using `Connections::ExternallyPaginatedArrayConnection`' do + connection = implementations[Gitlab::Graphql::ExternallyPaginatedArray.name] + + expect(connection).to eq(Gitlab::Graphql::Connections::ExternallyPaginatedArrayConnection) + end + + it 'paginates FilterableArray using `Connections::FilterableArrayConnection`' do + connection = implementations[Gitlab::Graphql::FilterableArray.name] + + expect(connection).to eq(Gitlab::Graphql::Connections::FilterableArrayConnection) + end + + it 'paginates OffsetActiveRecordRelation using `Pagination::OffsetActiveRecordRelationConnection`' do + connection = implementations[Gitlab::Graphql::Pagination::Relations::OffsetActiveRecordRelation.name] + + expect(connection).to eq(Gitlab::Graphql::Pagination::OffsetActiveRecordRelationConnection) + end + describe '.execute' do context 'for different types of users' do context 'when no context' do |