summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/diff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-23 18:06:14 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-23 18:06:14 +0000
commitc792263edfaf826c58f4aa41d26904464a17a3e7 (patch)
treeb57ae96c9eeaf0a1432a29f7f50f2fce9529818d /spec/lib/gitlab/diff
parent6f9edd1a4c4942d3d13ec54793cfae56164b1a0a (diff)
downloadgitlab-ce-c792263edfaf826c58f4aa41d26904464a17a3e7.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/diff')
-rw-r--r--spec/lib/gitlab/diff/position_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/lib/gitlab/diff/position_spec.rb b/spec/lib/gitlab/diff/position_spec.rb
index 399787635c0..839780b53fe 100644
--- a/spec/lib/gitlab/diff/position_spec.rb
+++ b/spec/lib/gitlab/diff/position_spec.rb
@@ -130,6 +130,26 @@ describe Gitlab::Diff::Position do
expect(diff_file.new_path).to eq(subject.new_path)
expect(diff_file.diff_refs).to eq(subject.diff_refs)
end
+
+ context 'different folded positions in the same diff file' do
+ def diff_file(args = {})
+ described_class
+ .new(args_for_text.merge(args))
+ .diff_file(project.repository)
+ end
+
+ it 'expands the diff file', :request_store do
+ expect_any_instance_of(Gitlab::Diff::File)
+ .to receive(:unfold_diff_lines).and_call_original
+
+ diff_file(old_line: 1, new_line: 1, diff_refs: commit.diff_refs)
+
+ expect_any_instance_of(Gitlab::Diff::File)
+ .to receive(:unfold_diff_lines).and_call_original
+
+ diff_file(old_line: 5, new_line: 5, diff_refs: commit.diff_refs)
+ end
+ end
end
describe "#diff_line" do