diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/models/merge_request_diff_spec.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/models/merge_request_diff_spec.rb')
-rw-r--r-- | spec/models/merge_request_diff_spec.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/models/merge_request_diff_spec.rb b/spec/models/merge_request_diff_spec.rb index e0e25031589..5fff880c44e 100644 --- a/spec/models/merge_request_diff_spec.rb +++ b/spec/models/merge_request_diff_spec.rb @@ -240,7 +240,7 @@ RSpec.describe MergeRequestDiff do stub_external_diffs_setting(enabled: true) expect(diff).not_to receive(:save!) - expect(Gitlab::Database) + expect(Gitlab::Database.main) .to receive(:bulk_insert) .with('merge_request_diff_files', anything) .and_raise(ActiveRecord::Rollback) @@ -465,11 +465,13 @@ RSpec.describe MergeRequestDiff do it 'sorts diff files directory first' do diff_with_commits.update!(sorted: false) # Mark as unsorted so it'll re-order - expect(diff_with_commits.diffs_in_batch(0, 10, diff_options: diff_options).diff_file_paths).to eq([ + # There will be 11 returned, as we have to take into account for new and old paths + expect(diff_with_commits.diffs_in_batch(0, 10, diff_options: diff_options).diff_paths).to eq([ 'bar/branch-test.txt', 'custom-highlighting/test.gitlab-custom', 'encoding/iso8859.txt', 'files/images/wm.svg', + 'files/js/commit.js.coffee', 'files/js/commit.coffee', 'files/lfs/lfs_object.iso', 'files/ruby/popen.rb', @@ -553,11 +555,12 @@ RSpec.describe MergeRequestDiff do it 'sorts diff files directory first' do diff_with_commits.update!(sorted: false) # Mark as unsorted so it'll re-order - expect(diff_with_commits.diffs(diff_options).diff_file_paths).to eq([ + expect(diff_with_commits.diffs(diff_options).diff_paths).to eq([ 'bar/branch-test.txt', 'custom-highlighting/test.gitlab-custom', 'encoding/iso8859.txt', 'files/images/wm.svg', + 'files/js/commit.js.coffee', 'files/js/commit.coffee', 'files/lfs/lfs_object.iso', 'files/ruby/popen.rb', |