diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-08-11 15:23:15 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-08-11 18:41:19 +0300 |
commit | f1ccff47b10b253b9dff323f667ae45ef3c77028 (patch) | |
tree | 2501ae94abc03081fd81c639558e71c3f10f0a4f /spec | |
parent | 75dffc45d90391d09ba320605d6c7a6ec7dd8a18 (diff) |
Merge branch '36328-deserializemergerequestdiffsandcommits-fails-due-to-null-too_large-column-9-5-rc1' into 'master'
Fix merge request diff deserialisation when too_large was absent
Closes #36328
See merge request !13500
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits_spec.rb b/spec/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits_spec.rb index 18843cbe992..c5ec23b1ac6 100644 --- a/spec/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits_spec.rb +++ b/spec/lib/gitlab/background_migration/deserialize_merge_request_diffs_and_commits_spec.rb @@ -123,6 +123,17 @@ describe Gitlab::BackgroundMigration::DeserializeMergeRequestDiffsAndCommits do include_examples 'updated MR diff' end + context 'when the merge request diffs do not have too_large set' do + let(:commits) { merge_request_diff.commits.map(&:to_hash) } + let(:expected_diffs) { diffs_to_hashes(merge_request_diff.merge_request_diff_files) } + + let(:diffs) do + expected_diffs.map { |diff| diff.except(:too_large) } + end + + include_examples 'updated MR diff' + end + context 'when the merge request diffs have binary content' do let(:commits) { merge_request_diff.commits.map(&:to_hash) } let(:expected_diffs) { diffs } |