diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /spec/lib/gitlab/graphql/pagination/keyset | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) | |
download | gitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/lib/gitlab/graphql/pagination/keyset')
-rw-r--r-- | spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb b/spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb index fdacecbaca6..ba77bc95bb5 100644 --- a/spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb +++ b/spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb @@ -9,6 +9,14 @@ describe Gitlab::Graphql::Pagination::Keyset::Connection do let(:schema) { GraphQL::Schema.define(query: query_type, mutation: nil)} let(:context) { GraphQL::Query::Context.new(query: OpenStruct.new(schema: schema), values: nil, object: nil) } + before do + stub_const('NoPrimaryKey', Class.new(ActiveRecord::Base)) + NoPrimaryKey.class_eval do + self.table_name = 'no_primary_key' + self.primary_key = nil + end + end + subject(:connection) do described_class.new(nodes, { context: context, max_page_size: 3 }.merge(arguments)) end @@ -18,7 +26,7 @@ describe Gitlab::Graphql::Pagination::Keyset::Connection do end def decoded_cursor(cursor) - JSON.parse(Base64Bp.urlsafe_decode64(cursor)) + Gitlab::Json.parse(Base64Bp.urlsafe_decode64(cursor)) end describe '#cursor_for' do @@ -303,9 +311,4 @@ describe Gitlab::Graphql::Pagination::Keyset::Connection do end end end - - class NoPrimaryKey < ActiveRecord::Base - self.table_name = 'no_primary_key' - self.primary_key = nil - end end |