diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 06:09:37 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-07 06:09:37 +0300 |
commit | 3e59f1f11a387ab3e0383f7beea8ea599291a293 (patch) | |
tree | 6fbbe3ba17b30e60e535d73912b99f794d746d01 /spec/models | |
parent | 1e19d757e8a088e9d4aa67cc092fda87aba1cd35 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/note_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index f722415d428..1453ce9709f 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -1695,6 +1695,30 @@ RSpec.describe Note, feature_category: :team_planning do end end end + + describe '.authored_by' do + subject(:notes_by_author) { described_class.authored_by(author) } + + let(:author) { create(:user) } + + it 'returns the notes with the matching author' do + note = create(:note, author: author) + create(:note) + + expect(notes_by_author).to contain_exactly(note) + end + + context 'With ID integer' do + subject(:notes_by_author) { described_class.authored_by(author.id) } + + it 'returns the notes with the matching author' do + note = create(:note, author: author) + create(:note) + + expect(notes_by_author).to contain_exactly(note) + end + end + end end describe 'banzai_render_context' do |