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:
Robert Riemann
2016-02-23 20:57:54 +01:00
parent eb87cffa13
commit 9c39647cd2
5 changed files with 25 additions and 3 deletions

View File

@ -426,6 +426,11 @@ describe Post do
expect(post.raw_mentions).to eq(['jake', 'finn', 'jake_old'])
end
it "handles hyphen in groupname" do
post = Fabricate.build(:post, post_args.merge(raw: "@org-board"))
expect(post.raw_mentions).to eq(['org-board'])
end
end
context "max mentions" do