Remove unused formatted_birthday from profile model
This commit is contained in:
parent
77951c4657
commit
b61536ff06
2 changed files with 0 additions and 28 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue