diff options
author | Mark Chao <mchao@gitlab.com> | 2019-03-21 16:38:52 +0300 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2019-03-21 18:08:29 +0300 |
commit | 8723f292552814cfe4566f213005e4e190fca456 (patch) | |
tree | 22b2a5bc1188ae7467d12c9e640fc1998a020741 /spec/lib/gitlab/diff | |
parent | 8a59c9fdba4572cdfd60be6630d96fd37dc35654 (diff) |
Fix diff bottom expand button appears twice
This is a quick fix by only append match line once
when calling diff_lines_for_serializer multiple time.
Also enable feature by default
Diffstat (limited to 'spec/lib/gitlab/diff')
-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') } |