diff options
author | Douwe Maan <douwe@gitlab.com> | 2019-03-21 16:43:54 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-03-21 16:43:54 +0000 |
commit | 7d3c5d882c1ddb7a78241e326996f30d67fce4b8 (patch) | |
tree | 42dc69e644450a39fa700e3840a963bac438eec4 /spec | |
parent | 1bc4ee3f9a06a8d8fc70b97db90ca5e8e3434604 (diff) | |
parent | 8723f292552814cfe4566f213005e4e190fca456 (diff) | |
download | gitlab-ce-7d3c5d882c1ddb7a78241e326996f30d67fce4b8.tar.gz |
Merge branch '59147-duplicate-match-line' into 'master'
Fix duplicated bottom match line
Closes #59147
See merge request gitlab-org/gitlab-ce!26402
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/diff/file_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/lib/gitlab/diff/file_spec.rb b/spec/lib/gitlab/diff/file_spec.rb index 611c3e946ed..cc36060f864 100644 --- a/spec/lib/gitlab/diff/file_spec.rb +++ b/spec/lib/gitlab/diff/file_spec.rb @@ -72,6 +72,13 @@ describe Gitlab::Diff::File do expect(diff_file.diff_lines_for_serializer.last.type).to eq('match') end + context 'when called multiple times' do + it 'only adds bottom match line once' do + expect(diff_file.diff_lines_for_serializer.size).to eq(31) + expect(diff_file.diff_lines_for_serializer.size).to eq(31) + end + end + context 'when deleted' do let(:commit) { project.commit('d59c60028b053793cecfb4022de34602e1a9218e') } let(:diff_file) { commit.diffs.diff_file_with_old_path('files/js/commit.js.coffee') } |