diff options
author | Stan Hu <stanhu@gmail.com> | 2018-11-01 09:51:42 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-11-01 09:51:42 -0700 |
commit | 9338c11f61432cccc939c0912877c1b128b9b668 (patch) | |
tree | 9f8780b6b92bc61e4c8d46f4dbe7d163e4725738 /spec | |
parent | de1db4972cff7539b4ed490e9ebaf87f06500bbd (diff) | |
download | gitlab-ce-9338c11f61432cccc939c0912877c1b128b9b668.tar.gz |
Fix merge request specs that expect diff_files to be calledsh-optimize-reload-diffs-service
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/merge_request_diff_spec.rb | 12 | ||||
-rw-r--r-- | spec/models/merge_request_spec.rb | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/spec/models/merge_request_diff_spec.rb b/spec/models/merge_request_diff_spec.rb index 90cce826b6c..562ccaf6c0b 100644 --- a/spec/models/merge_request_diff_spec.rb +++ b/spec/models/merge_request_diff_spec.rb @@ -52,9 +52,9 @@ describe MergeRequestDiff do context 'when it was not cleaned by the system' do it 'returns persisted diffs' do - expect(diff).to receive(:load_diffs) + expect(diff).to receive(:load_diffs).and_call_original - diff.diffs + diff.diffs.diff_files end end @@ -76,19 +76,19 @@ describe MergeRequestDiff do end it 'returns persisted diffs if cannot compare with diff refs' do - expect(diff).to receive(:load_diffs) + expect(diff).to receive(:load_diffs).and_call_original diff.update!(head_commit_sha: 'invalid-sha') - diff.diffs + diff.diffs.diff_files end it 'returns persisted diffs if diff refs does not exist' do - expect(diff).to receive(:load_diffs) + expect(diff).to receive(:load_diffs).and_call_original diff.update!(start_commit_sha: nil, base_commit_sha: nil) - diff.diffs + diff.diffs.diff_files end end end diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index c8943f2d86f..37f1456710d 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -538,9 +538,9 @@ describe MergeRequest do it 'delegates to the MR diffs' do merge_request.save - expect(merge_request.merge_request_diff).to receive(:raw_diffs).with(hash_including(options)) + expect(merge_request.merge_request_diff).to receive(:raw_diffs).with(hash_including(options)).and_call_original - merge_request.diffs(options) + merge_request.diffs(options).diff_files end end |