Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-06-19 21:25:06 +0300
committerClement Ho <ClemMakesApps@gmail.com>2017-06-19 23:45:23 +0300
commit80b6a6e1f23674800c081f717186b5cb8e72c4cf (patch)
treea2187672355c4d41de3d8c0d56d78c884e73b2b2 /spec
parenta23e97664292468b57af1eee62382a27833f70c5 (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.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/helpers/diff_helper_spec.rb b/spec/helpers/diff_helper_spec.rb
index a74615e07f9..3ea0a7e2874 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