improve reviving_old_topic education message
This commit is contained in:
parent
8b59ce9183
commit
7b4e6d508b
|
@ -363,7 +363,7 @@ en:
|
||||||
reviving_old_topic: |
|
reviving_old_topic: |
|
||||||
### Revive this 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?
|
Are you sure you want to continue this old conversation?
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ class ComposerMessagesFinder
|
||||||
templateName: 'education',
|
templateName: 'education',
|
||||||
wait_for_typing: false,
|
wait_for_typing: false,
|
||||||
extraClass: 'education-message',
|
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
|
end
|
||||||
|
|
||||||
|
|
|
@ -442,7 +442,9 @@ describe ComposerMessagesFinder do
|
||||||
|
|
||||||
it "notifies if last post is old" do
|
it "notifies if last post is old" do
|
||||||
topic = Fabricate(:topic, last_posted_at: 181.days.ago)
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue