Expose age_range instead of date_of_birth for Voter/User class

This commit is contained in:
Alberto Miedes Garcés
2017-01-02 14:12:37 +01:00
parent f4e0ef7eea
commit 0b4004042f
5 changed files with 43 additions and 4 deletions

View File

@@ -469,4 +469,10 @@ describe User do
end
describe "#age_range" do
it 'returns string representation of age range' do
user = create(:user, date_of_birth: Time.current - 41.years)
expect(user.age_range).to eq('41..60')
end
end
end