mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Check whether group is mentionable by user when cooking post.
This commit is contained in:
@@ -225,7 +225,9 @@ describe PrettyText do
|
||||
Fabricate(:user, username: username)
|
||||
end
|
||||
|
||||
group = Fabricate(:group)
|
||||
group = Fabricate(:group,
|
||||
mentionable_level: Group::ALIAS_LEVELS[:everyone]
|
||||
)
|
||||
|
||||
[
|
||||
[
|
||||
@@ -241,6 +243,14 @@ describe PrettyText do
|
||||
end
|
||||
end
|
||||
|
||||
it "does not create mention for a non mentionable group" do
|
||||
group = Fabricate(:group, mentionable_level: Group::ALIAS_LEVELS[:nobody])
|
||||
|
||||
expect(PrettyText.cook("test @#{group.name} test")).to eq(
|
||||
%Q|<p>test <span class="mention">@#{group.name}</span> test</p>|
|
||||
)
|
||||
end
|
||||
|
||||
it 'does not mention staged users' do
|
||||
user = Fabricate(:user, staged: true)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user