diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/models/diff_note_spec.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/models/diff_note_spec.rb')
-rw-r--r-- | spec/models/diff_note_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/models/diff_note_spec.rb b/spec/models/diff_note_spec.rb index 11652d9841b..f377b34679c 100644 --- a/spec/models/diff_note_spec.rb +++ b/spec/models/diff_note_spec.rb @@ -558,4 +558,31 @@ RSpec.describe DiffNote do it { is_expected.to eq('note') } end + + describe '#shas' do + it 'returns list of SHAs based on original_position' do + expect(subject.shas).to match_array([ + position.base_sha, + position.start_sha, + position.head_sha + ]) + end + + context 'when position changes' do + before do + subject.position = new_position + end + + it 'includes the new position SHAs' do + expect(subject.shas).to match_array([ + position.base_sha, + position.start_sha, + position.head_sha, + new_position.base_sha, + new_position.start_sha, + new_position.head_sha + ]) + end + end + end end |