summaryrefslogtreecommitdiff
path: root/spec/graphql
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-04-04 18:52:29 +0100
committerNick Thomas <nick@gitlab.com>2019-04-04 18:57:34 +0100
commitbeeeede2eed9bd78a5948178e270935fa9d92c51 (patch)
tree70b7158dbfe0254de807404f175ec572da629736 /spec/graphql
parent465f82e32cd1ca7c87ca7553e350af4c52b00805 (diff)
downloadgitlab-ce-beeeede2eed9bd78a5948178e270935fa9d92c51.tar.gz
Fix a KeyError in GitlabSchema
Diffstat (limited to 'spec/graphql')
-rw-r--r--spec/graphql/gitlab_schema_spec.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/graphql/gitlab_schema_spec.rb b/spec/graphql/gitlab_schema_spec.rb
index a535d9cdc7e..74e93b2c4df 100644
--- a/spec/graphql/gitlab_schema_spec.rb
+++ b/spec/graphql/gitlab_schema_spec.rb
@@ -34,12 +34,22 @@ describe GitlabSchema do
end
context 'for different types of users' do
- it 'returns DEFAULT_MAX_COMPLEXITY for no user' do
- expect(GraphQL::Schema).to receive(:execute).with('query', hash_including(max_complexity: GitlabSchema::DEFAULT_MAX_COMPLEXITY))
+ it 'returns DEFAULT_MAX_COMPLEXITY for no context' do
+ expect(GraphQL::Schema)
+ .to receive(:execute)
+ .with('query', hash_including(max_complexity: GitlabSchema::DEFAULT_MAX_COMPLEXITY))
described_class.execute('query')
end
+ it 'returns DEFAULT_MAX_COMPLEXITY for no user' do
+ expect(GraphQL::Schema)
+ .to receive(:execute)
+ .with('query', hash_including(max_complexity: GitlabSchema::DEFAULT_MAX_COMPLEXITY))
+
+ described_class.execute('query', context: {})
+ end
+
it 'returns AUTHENTICATED_COMPLEXITY for a logged in user' do
user = build :user