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/projects/branches_controller_spec.rb')
-rw-r--r--spec/controllers/projects/branches_controller_spec.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/controllers/projects/branches_controller_spec.rb b/spec/controllers/projects/branches_controller_spec.rb
index a00e302a64f..43e8bbd83cf 100644
--- a/spec/controllers/projects/branches_controller_spec.rb
+++ b/spec/controllers/projects/branches_controller_spec.rb
@@ -239,7 +239,7 @@ RSpec.describe Projects::BranchesController do
end
end
- context 'without issue feature access' do
+ context 'without issue feature access', :sidekiq_inline do
before do
project.update!(visibility_level: Gitlab::VisibilityLevel::PUBLIC)
project.project_feature.update!(issues_access_level: ProjectFeature::PRIVATE)
@@ -656,6 +656,26 @@ RSpec.describe Projects::BranchesController do
)
end
end
+
+ context 'when gitaly is not available' do
+ 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)
+ end
+
+ it 'sets gitaly_unavailable variable' do
+ expect(assigns[:gitaly_unavailable]).to be_truthy
+ end
+ end
end
describe 'GET diverging_commit_counts' do