diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-05 09:14:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-05 09:14:37 +0300 |
commit | 0e31e4396d76a8d723a26354278295fd0c51d9c7 (patch) | |
tree | 5ef2c0756659a7210bdb1055fd610ca47b28f0f7 /spec/helpers | |
parent | c20abe491ceeb1b8e1350f18f0c91e0a31c73cb5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/avatars_helper_spec.rb | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/spec/helpers/avatars_helper_spec.rb b/spec/helpers/avatars_helper_spec.rb index 2c12513c8ac..18cbbaf2008 100644 --- a/spec/helpers/avatars_helper_spec.rb +++ b/spec/helpers/avatars_helper_spec.rb @@ -7,7 +7,7 @@ RSpec.describe AvatarsHelper, feature_category: :source_code_management do let_it_be(:user) { create(:user) } - describe '#project_icon, #group_icon, #topic_icon' do + describe '#group_icon, #topic_icon' do shared_examples 'resource with a default avatar' do |source_type| it 'returns a default avatar div' do expect(public_send("#{source_type}_icon", *helper_args)) @@ -27,37 +27,7 @@ RSpec.describe AvatarsHelper, feature_category: :source_code_management do allow(resource).to receive(:avatar_url).and_raise(error_class) end - it 'handles Gitaly exception gracefully' do - expect(Gitlab::ErrorTracking).to receive(:track_exception).with( - an_instance_of(error_class), source_type: 'Project', source_id: resource.id - ) - expect { project_icon(resource) }.not_to raise_error - end - - it_behaves_like 'resource with a default avatar', 'project' - end - - context 'when providing a project' do - let(:helper_args) { [resource] } - let(:resource) { create(:project, name: 'foo') } - it_behaves_like 'resource with a default avatar', 'project' - - it_behaves_like 'resource with a custom avatar', 'project' do - let(:resource) { create(:project, :public, avatar: File.open(uploaded_image_temp_path)) } - end - - context 'when Gitaly is unavailable' do - let(:error_class) { GRPC::Unavailable } - - include_examples 'Gitaly exception handling' - end - - context 'when Gitaly request is taking too long' do - let(:error_class) { GRPC::DeadlineExceeded } - - include_examples 'Gitaly exception handling' - end end context 'when providing a group' do |