diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 21:38:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 21:38:24 +0300 |
commit | 983a0bba5d2a042c4a3bbb22432ec192c7501d82 (patch) | |
tree | b153cd387c14ba23bd5a07514c7c01fddf6a78a0 /spec/support/shared_examples/requests/api/diff_discussions_shared_examples.rb | |
parent | a2bddee2cdb38673df0e004d5b32d9f77797de64 (diff) |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'spec/support/shared_examples/requests/api/diff_discussions_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/requests/api/diff_discussions_shared_examples.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/support/shared_examples/requests/api/diff_discussions_shared_examples.rb b/spec/support/shared_examples/requests/api/diff_discussions_shared_examples.rb index 583475678f1..3d25b9076ad 100644 --- a/spec/support/shared_examples/requests/api/diff_discussions_shared_examples.rb +++ b/spec/support/shared_examples/requests/api/diff_discussions_shared_examples.rb @@ -22,12 +22,18 @@ RSpec.shared_examples 'diff discussions API' do |parent_type, noteable_type, id_ expect(json_response['id']).to eq(diff_note.discussion_id) expect(json_response['notes'].first['body']).to eq(diff_note.note) expect(json_response['notes'].first['position']).to eq(diff_note.position.to_h.stringify_keys) + expect(json_response['notes'].first['line_range']).to eq(nil) end end describe "POST /#{parent_type}/:id/#{noteable_type}/:noteable_id/discussions" do it "creates a new diff note" do - position = diff_note.position.to_h + line_range = { + "start_line_code" => Gitlab::Git.diff_line_code(diff_note.position.file_path, 1, 1), + "end_line_code" => Gitlab::Git.diff_line_code(diff_note.position.file_path, 2, 2) + } + + position = diff_note.position.to_h.merge({ line_range: line_range }) post api("/#{parent_type}/#{parent.id}/#{noteable_type}/#{noteable[id_name]}/discussions", user), params: { body: 'hi!', position: position } |