summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/branches_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/projects/branches_controller_spec.rb')
-rw-r--r--spec/controllers/projects/branches_controller_spec.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/controllers/projects/branches_controller_spec.rb b/spec/controllers/projects/branches_controller_spec.rb
index ea22e6b6f10..1580ad9361d 100644
--- a/spec/controllers/projects/branches_controller_spec.rb
+++ b/spec/controllers/projects/branches_controller_spec.rb
@@ -688,21 +688,23 @@ RSpec.describe Projects::BranchesController do
end
context 'when gitaly is not available' do
+ let(:request) { get :index, format: :html, params: { namespace_id: project.namespace, project_id: project } }
+
before do
allow_next_instance_of(Gitlab::GitalyClient::RefService) do |ref_service|
allow(ref_service).to receive(:local_branches).and_raise(GRPC::DeadlineExceeded)
end
-
- get :index, format: :html, params: {
- namespace_id: project.namespace, project_id: project
- }
end
- it 'returns with a status 200' do
- expect(response).to have_gitlab_http_status(:ok)
+ it 'returns with a status 503' do
+ request
+
+ expect(response).to have_gitlab_http_status(:service_unavailable)
end
it 'sets gitaly_unavailable variable' do
+ request
+
expect(assigns[:gitaly_unavailable]).to be_truthy
end
end