Remove unused `ApplicationHelper#visibility_icon` helper method (#32644)
parent
d11231a420
commit
745c4f900a
|
@ -120,18 +120,6 @@ module ApplicationHelper
|
||||||
inline_svg_tag 'check.svg'
|
inline_svg_tag 'check.svg'
|
||||||
end
|
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)
|
def interrelationships_icon(relationships, account_id)
|
||||||
if relationships.following[account_id] && relationships.followed_by[account_id]
|
if relationships.following[account_id] && relationships.followed_by[account_id]
|
||||||
material_symbol('sync_alt', title: I18n.t('relationships.mutual'), class: 'active passive')
|
material_symbol('sync_alt', title: I18n.t('relationships.mutual'), class: 'active passive')
|
||||||
|
|
|
@ -227,28 +227,6 @@ RSpec.describe ApplicationHelper do
|
||||||
end
|
end
|
||||||
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
|
describe 'title' do
|
||||||
it 'returns site title on production environment' do
|
it 'returns site title on production environment' do
|
||||||
Setting.site_title = 'site title'
|
Setting.site_title = 'site title'
|
||||||
|
|
Loading…
Reference in New Issue