diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-06-19 21:25:06 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-06-19 21:25:06 +0300 |
commit | 365670d814bf57396a9ce02190fa297d15c79cb9 (patch) | |
tree | 874e443734883f6bf020a9da42bfbe79af5e2d59 /spec | |
parent | 435d1a01749a2b0a3d96ef3802aaa382e5b78429 (diff) | |
parent | 5e8aca215243d2eaacb0a1b744909af2b7264a32 (diff) |
Merge branch 'dm-parallel-diff-unchanged-line-comment' into 'master'
Don't display comment on unchanged line on both sides in parallel diff
Closes #33864
See merge request !12275
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/diff_helper_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/helpers/diff_helper_spec.rb b/spec/helpers/diff_helper_spec.rb index 0ac030d3171..0d909e6e140 100644 --- a/spec/helpers/diff_helper_spec.rb +++ b/spec/helpers/diff_helper_spec.rb @@ -148,12 +148,21 @@ describe DiffHelper do it 'puts comments on added lines' do left = Gitlab::Diff::Line.new('\\nonewline', 'old-nonewline', 3, 3, 3) - right = Gitlab::Diff::Line.new('new line', 'add', 3, 3, 3) + right = Gitlab::Diff::Line.new('new line', 'new', 3, 3, 3) result = helper.parallel_diff_discussions(left, right, diff_file) expect(result).to eq([nil, 'comment']) end + + it 'puts comments on unchanged lines' do + left = Gitlab::Diff::Line.new('unchanged line', nil, 3, 3, 3) + right = Gitlab::Diff::Line.new('unchanged line', nil, 3, 3, 3) + + result = helper.parallel_diff_discussions(left, right, diff_file) + + expect(result).to eq(['comment', nil]) + end end describe "#diff_match_line" do |