diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/helpers/avatars_helper_spec.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/helpers/avatars_helper_spec.rb')
-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 |