From 745c4f900af31ef1282fd4ac6b982293fea5bed6 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 24 Oct 2024 04:02:54 -0400 Subject: [PATCH] Remove unused `ApplicationHelper#visibility_icon` helper method (#32644) --- app/helpers/application_helper.rb | 12 ------------ spec/helpers/application_helper_spec.rb | 22 ---------------------- 2 files changed, 34 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4caf0398f..e36de1925 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -120,18 +120,6 @@ module ApplicationHelper inline_svg_tag 'check.svg' end - def visibility_icon(status) - if status.public_visibility? - material_symbol('globe', title: I18n.t('statuses.visibilities.public')) - elsif status.unlisted_visibility? - material_symbol('lock_open', title: I18n.t('statuses.visibilities.unlisted')) - elsif status.private_visibility? || status.limited_visibility? - material_symbol('lock', title: I18n.t('statuses.visibilities.private')) - elsif status.direct_visibility? - material_symbol('alternate_email', title: I18n.t('statuses.visibilities.direct')) - end - end - def interrelationships_icon(relationships, account_id) if relationships.following[account_id] && relationships.followed_by[account_id] material_symbol('sync_alt', title: I18n.t('relationships.mutual'), class: 'active passive') diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 0f78dc82f..ffcc5b81b 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -227,28 +227,6 @@ RSpec.describe ApplicationHelper do end end - describe 'visibility_icon' do - it 'returns a globe icon for a public visible status' do - result = helper.visibility_icon Status.new(visibility: 'public') - expect(result).to match(/globe/) - end - - it 'returns an unlock icon for a unlisted visible status' do - result = helper.visibility_icon Status.new(visibility: 'unlisted') - expect(result).to match(/lock_open/) - end - - it 'returns a lock icon for a private visible status' do - result = helper.visibility_icon Status.new(visibility: 'private') - expect(result).to match(/lock/) - end - - it 'returns an at icon for a direct visible status' do - result = helper.visibility_icon Status.new(visibility: 'direct') - expect(result).to match(/alternate_email/) - end - end - describe 'title' do it 'returns site title on production environment' do Setting.site_title = 'site title'