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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/graphql_controller_spec.rb')
-rw-r--r--spec/controllers/graphql_controller_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/controllers/graphql_controller_spec.rb b/spec/controllers/graphql_controller_spec.rb
index e85f5b7a972..1d2f1085d3c 100644
--- a/spec/controllers/graphql_controller_spec.rb
+++ b/spec/controllers/graphql_controller_spec.rb
@@ -27,6 +27,18 @@ RSpec.describe GraphqlController do
)
end
+ it 'handles a timeout nicely' do
+ allow(subject).to receive(:execute) do
+ raise ActiveRecord::QueryCanceled, '**taps wristwatch**'
+ end
+
+ post :execute
+
+ expect(json_response).to include(
+ 'errors' => include(a_hash_including('message' => /Request timed out/))
+ )
+ end
+
it 'handles StandardError' do
allow(subject).to receive(:execute) do
raise StandardError, message