diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-03 15:06:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-03 15:06:34 +0300 |
commit | cd4cb29b2c304f00d238ee72fe40c767cb3e2675 (patch) | |
tree | 4dba0f038795f8d8f43ed807a1b7f58af27b61a9 /spec/lib/banzai | |
parent | 2b339d4e892045d1d7be117d1557a5394ebd6e72 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/banzai')
-rw-r--r-- | spec/lib/banzai/reference_parser/user_parser_spec.rb | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/spec/lib/banzai/reference_parser/user_parser_spec.rb b/spec/lib/banzai/reference_parser/user_parser_spec.rb index 931fb1e3953..71d2e1de3b6 100644 --- a/spec/lib/banzai/reference_parser/user_parser_spec.rb +++ b/spec/lib/banzai/reference_parser/user_parser_spec.rb @@ -19,15 +19,23 @@ describe Banzai::ReferenceParser::UserParser do link['data-group'] = project.group.id.to_s end - it 'returns the users of the group' do - create(:group_member, group: group, user: user) - - expect(subject.referenced_by([link])).to eq([user]) - end - it 'returns an empty Array when the group has no users' do expect(subject.referenced_by([link])).to eq([]) end + + context 'when group has members' do + let!(:group_member) { create(:group_member, group: group, user: user) } + + it 'returns the users of the group' do + expect(subject.referenced_by([link])).to eq([user]) + end + + it 'returns an empty Array when the group has mentions disabled' do + group.update!(mentions_disabled: true) + + expect(subject.referenced_by([link])).to eq([]) + end + end end context 'using a non-existing group ID' do |