diff options
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/concerns/mentionable_spec.rb | 13 | ||||
-rw-r--r-- | spec/models/note_spec.rb | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/spec/models/concerns/mentionable_spec.rb b/spec/models/concerns/mentionable_spec.rb index 8321e0b89f8..63eb7473c97 100644 --- a/spec/models/concerns/mentionable_spec.rb +++ b/spec/models/concerns/mentionable_spec.rb @@ -30,12 +30,23 @@ describe Issue, "Mentionable" do describe '#mentioned_users' do let!(:user) { create(:user, username: 'stranger') } let!(:user2) { create(:user, username: 'john') } - let!(:issue) { create(:issue, description: "#{user.to_reference} mentioned") } + let!(:user3) { create(:user, username: 'jim') } + let(:issue) { create(:issue, description: "#{user.to_reference} mentioned") } subject { issue.mentioned_users } it { is_expected.to include(user) } it { is_expected.not_to include(user2) } + + context 'when a note on personal snippet' do + let!(:note) { create(:note_on_personal_snippet, note: "#{user.to_reference} mentioned #{user3.to_reference}") } + + subject { note.mentioned_users } + + it { is_expected.to include(user) } + it { is_expected.to include(user3) } + it { is_expected.not_to include(user2) } + end end describe '#referenced_mentionables' do diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index ddd62d7f0e6..8017bf7a13c 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -152,6 +152,7 @@ describe Note, models: true do with([{ text: note1.note, context: { + skip_project_check: false, pipeline: :note, cache_key: [note1, "note"], project: note1.project, @@ -163,6 +164,7 @@ describe Note, models: true do with([{ text: note2.note, context: { + skip_project_check: false, pipeline: :note, cache_key: [note2, "note"], project: note2.project, |