UX: Rephrase notification message (#417)

* UX: Rephrase notification message

* Fix specs
This commit is contained in:
Gerhard Schlager 2023-01-03 21:25:13 +01:00 committed by GitHub
parent 5d7c4ed8f7
commit 4777d0179c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -39,7 +39,7 @@ en:
flag_assigned: "Sorry, that flag's topic is assigned to another user" flag_assigned: "Sorry, that flag's topic is assigned to another user"
flag_unclaimed: "You must claim that topic before acting on the flag" flag_unclaimed: "You must claim that topic before acting on the flag"
topic_assigned_excerpt: "assigned you the topic '%{title}'" topic_assigned_excerpt: "assigned you the topic '%{title}'"
topic_group_assigned_excerpt: "assigned to %{group} the topic '%{title}'" topic_group_assigned_excerpt: "assigned the topic '%{title}' to @%{group}"
reminders_frequency: reminders_frequency:
never: "never" never: "never"
daily: "daily" daily: "daily"

View File

@ -39,7 +39,9 @@ RSpec.describe Jobs::AssignNotification do
end end
expect(messages.length).to eq(1) expect(messages.length).to eq(1)
expect(messages.first.data[:excerpt]).to eq("assigned you the topic 'Basic topic title'") expect(messages.first.data[:excerpt]).to eq(
I18n.t("discourse_assign.topic_assigned_excerpt", title: topic.title),
)
end end
it "should publish the right message when private message" do it "should publish the right message when private message" do
@ -120,7 +122,11 @@ RSpec.describe Jobs::AssignNotification do
end end
expect(messages.length).to eq(1) expect(messages.length).to eq(1)
expect(messages.first.data[:excerpt]).to eq( expect(messages.first.data[:excerpt]).to eq(
"assigned to Developers the topic 'Basic topic title'", I18n.t(
"discourse_assign.topic_group_assigned_excerpt",
title: topic.title,
group: group.name,
),
) )
messages = messages =
@ -139,7 +145,11 @@ RSpec.describe Jobs::AssignNotification do
end end
expect(messages.length).to eq(1) expect(messages.length).to eq(1)
expect(messages.first.data[:excerpt]).to eq( expect(messages.first.data[:excerpt]).to eq(
"assigned to Developers the topic 'Basic topic title'", I18n.t(
"discourse_assign.topic_group_assigned_excerpt",
title: topic.title,
group: group.name,
),
) )
messages = messages =