Remove unused formatted_birthday from profile model

This commit is contained in:
Benjamin Neff 2017-08-06 21:14:42 +02:00
parent 77951c4657
commit b61536ff06
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
2 changed files with 0 additions and 28 deletions

View file

@ -106,10 +106,6 @@ class Profile < ApplicationRecord
end
end
def formatted_birthday
birthday.to_s(:long).gsub(/, 100[0|4]/, "") if birthday.present?
end
def bio_message
@bio_message ||= Diaspora::MessageRenderer.new(bio)
end

View file

@ -269,30 +269,6 @@ describe Profile, :type => :model do
it_should_behave_like 'it is taggable'
end
describe '#formatted_birthday' do
before do
@profile = FactoryGirl.build(:profile)
@profile_hash = { 'year' => '2000', 'month' => '01', 'day' => '01' }
@profile.date = @profile_hash
end
it 'returns a formatted date' do
expect(@profile.formatted_birthday).to eq("January 1, 2000")
end
it 'removes nil year birthdays' do
@profile_hash.delete('year')
@profile.date = @profile_hash
expect(@profile.formatted_birthday).to eq('January 1')
end
it 'retuns nil if no birthday is set' do
@profile.date = {}
expect(@profile.formatted_birthday).to eq(nil)
end
end
describe "#tombstone!" do
before do
@profile = bob.person.profile