diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-02 09:01:02 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-02 09:01:02 +0000 |
commit | 2deb97adff1414d469e31ffad8582ab3c65bb80f (patch) | |
tree | 9cec6bfc0c08fa029ea46dc6dd99ec49dd6acbb7 /spec/models | |
parent | 0233fffe283857d9934460625f9c17fcd278536b (diff) | |
parent | fc4a0cd055643d6d66ed0dc8f0ba3ad5f09f6a95 (diff) | |
download | gitlab-ce-2deb97adff1414d469e31ffad8582ab3c65bb80f.tar.gz |
Merge branch '48246-osw-load-diffs-improvement' into 'master'
Filter diff files by given path on DB instead Ruby
See merge request gitlab-org/gitlab-ce!20940
Diffstat (limited to 'spec/models')
-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) |