mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
fix: support for hyphens in group name
The group mention @ORG-team triggers notifications for the group @ORG. This fix changes the RegExp, so that the group name is correctly extracted. see: https://meta.discourse.org/t/group-mentions-that-begin-with-the-same-characters-may-be-incorrect/39892/12?u=rriemann
This commit is contained in:
@@ -112,13 +112,20 @@ describe PostAlerter do
|
||||
|
||||
expect(GroupMention.count).to eq(1)
|
||||
|
||||
group.update_columns(alias_level: Group::ALIAS_LEVELS[:members_mods_and_admins])
|
||||
Fabricate(:group, name: 'group-alt', alias_level: Group::ALIAS_LEVELS[:everyone])
|
||||
|
||||
expect {
|
||||
create_post_with_alerts(raw: "Hello, @group-alt should not trigger a notification?")
|
||||
}.to change(evil_trout.notifications, :count).by(0)
|
||||
|
||||
expect(GroupMention.count).to eq(2)
|
||||
|
||||
group.update_columns(alias_level: Group::ALIAS_LEVELS[:members_mods_and_admins])
|
||||
expect {
|
||||
create_post_with_alerts(raw: "Hello @group you are not mentionable")
|
||||
}.to change(evil_trout.notifications, :count).by(0)
|
||||
|
||||
expect(GroupMention.count).to eq(2)
|
||||
expect(GroupMention.count).to eq(3)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user