summaryrefslogtreecommitdiff
path: root/spec/requests/api/internal_spec.rb
diff options
context:
space:
mode:
authorConstance Okoghenun <constanceokoghenun@gmail.com>2018-11-05 10:33:05 +0100
committerConstance Okoghenun <constanceokoghenun@gmail.com>2018-11-05 10:33:05 +0100
commit3bac1a322c82dd9b6e9b23edd66fa45afaa9859f (patch)
treed3e7d47a3e0c8047cb2972aefbc12fe1e3080ef8 /spec/requests/api/internal_spec.rb
parentfe7b6f57120946a5d5fe4a4d54a245dc76b06dc8 (diff)
parent9e2eb85e365e2a33e52e3f1f48cc23ad4201a52b (diff)
downloadgitlab-ce-issue_51323.tar.gz
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into issue_51323issue_51323
Diffstat (limited to 'spec/requests/api/internal_spec.rb')
-rw-r--r--spec/requests/api/internal_spec.rb24
1 files changed, 21 insertions, 3 deletions
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb
index e0b5b34f9c4..5ea869796b0 100644
--- a/spec/requests/api/internal_spec.rb
+++ b/spec/requests/api/internal_spec.rb
@@ -494,6 +494,24 @@ describe API::Internal do
end
end
+ context 'request times out' do
+ context 'git push' do
+ it 'responds with a gateway timeout' do
+ personal_project = create(:project, namespace: user.namespace)
+
+ expect_next_instance_of(Gitlab::GitAccess) do |access|
+ expect(access).to receive(:check).and_raise(Gitlab::GitAccess::TimeoutError, "Foo")
+ end
+ push(key, personal_project)
+
+ expect(response).to have_gitlab_http_status(503)
+ expect(json_response['status']).to be_falsey
+ expect(json_response['message']).to eq("Foo")
+ expect(user.reload.last_activity_on).to be_nil
+ end
+ end
+ end
+
context "archived project" do
before do
project.add_developer(user)
@@ -665,7 +683,7 @@ describe API::Internal do
expect(json_response).to match [{
"branch_name" => "new_branch",
- "url" => "http://#{Gitlab.config.gitlab.host}/#{project.namespace.name}/#{project.path}/merge_requests/new?merge_request%5Bsource_branch%5D=new_branch",
+ "url" => "http://#{Gitlab.config.gitlab.host}/#{project.namespace.name}/#{project.path}/merge_requests/new/new_branch",
"new_merge_request" => true
}]
end
@@ -686,7 +704,7 @@ describe API::Internal do
expect(json_response).to match [{
"branch_name" => "new_branch",
- "url" => "http://#{Gitlab.config.gitlab.host}/#{project.namespace.name}/#{project.path}/merge_requests/new?merge_request%5Bsource_branch%5D=new_branch",
+ "url" => "http://#{Gitlab.config.gitlab.host}/#{project.namespace.name}/#{project.path}/merge_requests/new/new_branch",
"new_merge_request" => true
}]
end
@@ -819,7 +837,7 @@ describe API::Internal do
expect(json_response['merge_request_urls']).to match [{
"branch_name" => "new_branch",
- "url" => "http://#{Gitlab.config.gitlab.host}/#{project.namespace.name}/#{project.path}/merge_requests/new?merge_request%5Bsource_branch%5D=new_branch",
+ "url" => "http://#{Gitlab.config.gitlab.host}/#{project.namespace.name}/#{project.path}/merge_requests/new/new_branch",
"new_merge_request" => true
}]
end