Commit dcd6f910 authored by marcheing's avatar marcheing Committed by Diego de Araújo Martinez Camarinha

Add full_name method to profile

Signed-off-by: Diego de Araújo Martinez Camarinha's avatarDiego Araújo <diegoamc@protonmail.ch>
parent 846efdfd
......@@ -13,4 +13,8 @@ class Profile < ApplicationRecord
def underaged?
!adult?
end
def full_name
"#{first_name} #{last_name}"
end
end
......@@ -64,5 +64,13 @@ RSpec.describe Profile, type: :model do
end
end
end
describe 'full_name' do
let(:profile) { build(:profile) }
it 'returns the first_name and last_name separated by whitespace' do
expect(profile.full_name).to eq("#{profile.first_name} #{profile.last_name}")
end
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment