diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-07-31 18:47:22 +0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2018-08-01 16:26:38 +0300 |
commit | fc4a0cd055643d6d66ed0dc8f0ba3ad5f09f6a95 (patch) | |
tree | 10edbe2ddaf174407f2867089f0cae14cac0f5fb /spec/models/merge_request_diff_spec.rb | |
parent | abae261b86d8a1eedb50e85083cad1a07154c4d3 (diff) |
Only serializes diff files found by paths query
Diffstat (limited to 'spec/models/merge_request_diff_spec.rb')
-rw-r--r-- | spec/models/merge_request_diff_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/models/merge_request_diff_spec.rb b/spec/models/merge_request_diff_spec.rb index 0aee78ac12d..90cce826b6c 100644 --- a/spec/models/merge_request_diff_spec.rb +++ b/spec/models/merge_request_diff_spec.rb @@ -127,6 +127,13 @@ describe MergeRequestDiff do expect(diffs.map(&:new_path)).to contain_exactly('files/ruby/popen.rb') end + it 'only serializes diff files found by query' do + expect(diff_with_commits.merge_request_diff_files.count).to be > 10 + expect_any_instance_of(MergeRequestDiffFile).to receive(:to_hash).once + + diffs + end + it 'uses the diffs from the DB' do expect(diff_with_commits).to receive(:load_diffs) |