From 4617629098d7fe9a8c0c14ad2c88e943baa321bd Mon Sep 17 00:00:00 2001 From: Dennis Schubert Date: Sat, 5 Mar 2016 10:19:40 +0100 Subject: [PATCH] Add spec for PeopleHelper#birthday_format closes #6738 --- Changelog.md | 1 + spec/helpers/people_helper_spec.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/Changelog.md b/Changelog.md index 7a73c4745..6657dd551 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ * Fix internal server error when trying to log out of an expired session [#6707](https://github.com/diaspora/diaspora/pull/6707) * Only mark unread notifications as read [#6711](https://github.com/diaspora/diaspora/pull/6711) * Use https for OEmbeds [#6748](https://github.com/diaspora/diaspora/pull/6748) +* Fix birthday issues on leap days [#6738](https://github.com/diaspora/diaspora/pull/6738) ## Features * Added the footer to conversation pages [#6710](https://github.com/diaspora/diaspora/pull/6710) diff --git a/spec/helpers/people_helper_spec.rb b/spec/helpers/people_helper_spec.rb index 2c5f13927..24f0bf445 100644 --- a/spec/helpers/people_helper_spec.rb +++ b/spec/helpers/people_helper_spec.rb @@ -10,6 +10,18 @@ describe PeopleHelper, :type => :helper do @person = FactoryGirl.create(:person) end + describe "#birthday_format" do + it "contains the birth year if available" do + birthday = Date.new 2016, 3, 5 + expect(birthday_format(birthday)).to include "2016" + end + + it "does not contain the birth year if placeholder year is used" do + birthday = Date.new 1004, 3, 5 + expect(birthday_format(birthday)).not_to include "1004" + end + end + describe "#person_image_link" do it "returns an empty string if person is nil" do expect(person_image_link(nil)).to eq("")