Commit 9338c11f authored by Stan Hu's avatar Stan Hu

Fix merge request specs that expect diff_files to be called

parent de1db497
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment