Merge branch 'hotfix/0.7.2.1'
This commit is contained in:
commit
a40824cd2b
4 changed files with 24 additions and 4 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
# 0.7.2.1
|
||||||
|
|
||||||
|
Fixes notifications when people remove their birthday date [#7691](https://github.com/diaspora/diaspora/pull/7691)
|
||||||
|
|
||||||
# 0.7.2.0
|
# 0.7.2.0
|
||||||
|
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ module NotificationsHelper
|
||||||
.include?(note.type)
|
.include?(note.type)
|
||||||
opts.merge!(opts_for_post(note.linked_object))
|
opts.merge!(opts_for_post(note.linked_object))
|
||||||
elsif note.is_a?(Notifications::ContactsBirthday)
|
elsif note.is_a?(Notifications::ContactsBirthday)
|
||||||
opts.merge!(opts_for_birthday(note.linked_object))
|
opts.merge!(opts_for_birthday(note))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
translation(target_type, opts)
|
translation(target_type, opts)
|
||||||
|
|
@ -46,8 +46,8 @@ module NotificationsHelper
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def opts_for_birthday(person)
|
def opts_for_birthday(note)
|
||||||
{date: locale_date(person.birthday.to_s)}
|
{date: I18n.l(note.created_at, format: I18n.t("date.formats.fullmonth_day"))}
|
||||||
end
|
end
|
||||||
|
|
||||||
def notification_people_link(note, people=nil)
|
def notification_people_link(note, people=nil)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
version:
|
version:
|
||||||
number: "0.7.2.0" # Do not touch unless doing a release, do not backport the version number that's in master
|
number: "0.7.2.1" # Do not touch unless doing a release, do not backport the version number that's in master
|
||||||
heroku: false
|
heroku: false
|
||||||
environment:
|
environment:
|
||||||
url: "http://localhost:3000/"
|
url: "http://localhost:3000/"
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,22 @@ describe NotificationsHelper, type: :helper do
|
||||||
expect(link).to include("#{post_path(status_message)}##{comment.guid}")
|
expect(link).to include("#{post_path(status_message)}##{comment.guid}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "for a birthday" do
|
||||||
|
let(:notification) { Notifications::ContactsBirthday.create(recipient: alice, target: bob.person) }
|
||||||
|
|
||||||
|
it "contains the date" do
|
||||||
|
bob.profile.update_attributes(birthday: Time.zone.today)
|
||||||
|
link = object_link(notification, notification_people_link(notification))
|
||||||
|
expect(link).to include(I18n.l(Time.zone.today, format: I18n.t("date.formats.fullmonth_day")))
|
||||||
|
end
|
||||||
|
|
||||||
|
it "doesn't break, when the person removes the birthday date" do
|
||||||
|
bob.profile.update_attributes(birthday: nil)
|
||||||
|
link = object_link(notification, notification_people_link(notification))
|
||||||
|
expect(link).to include(I18n.l(Time.zone.today, format: I18n.t("date.formats.fullmonth_day")))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#display_year?' do
|
describe '#display_year?' do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue