mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-06 09:51:24 +00:00
Remove unused obscured_counter
helper method (#35627)
This commit is contained in:
parent
fba24cc4eb
commit
483da67204
|
@ -39,16 +39,6 @@ module HomeHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def obscured_counter(count)
|
|
||||||
if count <= 0
|
|
||||||
'0'
|
|
||||||
elsif count == 1
|
|
||||||
'1'
|
|
||||||
else
|
|
||||||
'1+'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def field_verified_class(verified)
|
def field_verified_class(verified)
|
||||||
if verified
|
if verified
|
||||||
'verified'
|
'verified'
|
||||||
|
|
|
@ -41,40 +41,6 @@ RSpec.describe HomeHelper do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'obscured_counter' do
|
|
||||||
context 'with a value of less than zero' do
|
|
||||||
let(:count) { -10 }
|
|
||||||
|
|
||||||
it 'returns the correct string' do
|
|
||||||
expect(helper.obscured_counter(count)).to eq '0'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with a value of zero' do
|
|
||||||
let(:count) { 0 }
|
|
||||||
|
|
||||||
it 'returns the correct string' do
|
|
||||||
expect(helper.obscured_counter(count)).to eq '0'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with a value of one' do
|
|
||||||
let(:count) { 1 }
|
|
||||||
|
|
||||||
it 'returns the correct string' do
|
|
||||||
expect(helper.obscured_counter(count)).to eq '1'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with a value of more than one' do
|
|
||||||
let(:count) { 10 }
|
|
||||||
|
|
||||||
it 'returns the correct string' do
|
|
||||||
expect(helper.obscured_counter(count)).to eq '1+'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'field_verified_class' do
|
describe 'field_verified_class' do
|
||||||
subject { helper.field_verified_class(verified) }
|
subject { helper.field_verified_class(verified) }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user