diff options
Diffstat (limited to 'spec/requests/api/graphql_spec.rb')
-rw-r--r-- | spec/requests/api/graphql_spec.rb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/spec/requests/api/graphql_spec.rb b/spec/requests/api/graphql_spec.rb index 8a3c5261eb6..2e6ec6d02e7 100644 --- a/spec/requests/api/graphql_spec.rb +++ b/spec/requests/api/graphql_spec.rb @@ -42,13 +42,6 @@ RSpec.describe 'GraphQL', feature_category: :shared do post_graphql(query, variables: variables) end - - it 'does not instantiate any query analyzers' do # they are static and re-used - expect(GraphQL::Analysis::QueryComplexity).not_to receive(:new) - expect(GraphQL::Analysis::QueryDepth).not_to receive(:new) - - 2.times { post_graphql(query, variables: variables) } - end end context 'with no variables' do @@ -282,9 +275,9 @@ RSpec.describe 'GraphQL', feature_category: :shared do it 'does not authenticate user' do post_graphql(query, headers: { 'PRIVATE-TOKEN' => token.token }) - expect(response).to have_gitlab_http_status(:ok) + expect(response).to have_gitlab_http_status(:unauthorized) - expect(graphql_data['echo']).to eq('nil says: Hello world') + expect_graphql_errors_to_include('Invalid token') end end @@ -308,9 +301,9 @@ RSpec.describe 'GraphQL', feature_category: :shared do post_graphql(query, headers: { 'PRIVATE-TOKEN' => token.token }) - expect(response).to have_gitlab_http_status(:ok) + expect(response).to have_gitlab_http_status(:unauthorized) - expect(graphql_data['echo']).to eq('nil says: Hello world') + expect_graphql_errors_to_include('Invalid token') end end end |