improve reviving_old_topic education message

This commit is contained in:
Arpit Jalan 2018-01-26 00:06:53 +05:30
parent 8b59ce9183
commit 7b4e6d508b
3 changed files with 5 additions and 3 deletions

View File

@ -363,7 +363,7 @@ en:
reviving_old_topic: |
### Revive this topic?
The last reply to this topic was **%{days}** days ago. Your reply will bump the topic to the top of its list and notify anyone previously involved in the conversation.
The last reply to this topic was **%{time_ago}**. Your reply will bump the topic to the top of its list and notify anyone previously involved in the conversation.
Are you sure you want to continue this old conversation?

View File

@ -187,7 +187,7 @@ class ComposerMessagesFinder
templateName: 'education',
wait_for_typing: false,
extraClass: 'education-message',
body: PrettyText.cook(I18n.t('education.reviving_old_topic', days: (Time.zone.now - @topic.last_posted_at).round / 1.day))
body: PrettyText.cook(I18n.t('education.reviving_old_topic', time_ago: FreedomPatches::Rails4.time_ago_in_words(@topic.last_posted_at, false, scope: :'datetime.distance_in_words_verbose')))
}
end

View File

@ -442,7 +442,9 @@ describe ComposerMessagesFinder do
it "notifies if last post is old" do
topic = Fabricate(:topic, last_posted_at: 181.days.ago)
expect(described_class.new(user, composer_action: 'reply', topic_id: topic.id).check_reviving_old_topic).not_to be_blank
message = described_class.new(user, composer_action: 'reply', topic_id: topic.id).check_reviving_old_topic
expect(message).not_to be_blank
expect(message[:body]).to match(/6 months ago/)
end
end