diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-12 00:10:27 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-12 00:10:27 +0000 |
commit | a160c4b1a72105a751cdc2f9f973dbe39a1c0dfd (patch) | |
tree | 8383dcf5249407b3301289415ed9c3daccd43057 /spec/models/merge_request_diff_spec.rb | |
parent | 0ae8428c8e77d5d7e098827be688b1f146321af1 (diff) | |
download | gitlab-ce-a160c4b1a72105a751cdc2f9f973dbe39a1c0dfd.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/merge_request_diff_spec.rb')
-rw-r--r-- | spec/models/merge_request_diff_spec.rb | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/spec/models/merge_request_diff_spec.rb b/spec/models/merge_request_diff_spec.rb index 5101271d257..0e843f0d9dc 100644 --- a/spec/models/merge_request_diff_spec.rb +++ b/spec/models/merge_request_diff_spec.rb @@ -485,27 +485,6 @@ RSpec.describe MergeRequestDiff do 'files/whitespace' ]) end - - context 'when sort_diffs feature flag is disabled' do - before do - stub_feature_flags(sort_diffs: false) - end - - it 'does not sort diff files directory first' do - expect(diff_with_commits.diffs_in_batch(1, 10, diff_options: diff_options).diff_file_paths).to eq([ - '.DS_Store', - '.gitattributes', - '.gitignore', - '.gitmodules', - 'CHANGELOG', - 'README', - 'bar/branch-test.txt', - 'custom-highlighting/test.gitlab-custom', - 'encoding/iso8859.txt', - 'files/.DS_Store' - ]) - end - end end end @@ -581,37 +560,6 @@ RSpec.describe MergeRequestDiff do 'gitlab-shell' ]) end - - context 'when sort_diffs feature flag is disabled' do - before do - stub_feature_flags(sort_diffs: false) - end - - it 'does not sort diff files directory first' do - expect(diff_with_commits.diffs(diff_options).diff_file_paths).to eq([ - '.DS_Store', - '.gitattributes', - '.gitignore', - '.gitmodules', - 'CHANGELOG', - 'README', - 'bar/branch-test.txt', - 'custom-highlighting/test.gitlab-custom', - 'encoding/iso8859.txt', - 'files/.DS_Store', - 'files/images/wm.svg', - 'files/js/commit.coffee', - 'files/lfs/lfs_object.iso', - 'files/ruby/popen.rb', - 'files/ruby/regex.rb', - 'files/whitespace', - 'foo/bar/.gitkeep', - 'gitlab-grack', - 'gitlab-shell', - 'with space/README.md' - ]) - end - end end end @@ -718,40 +666,6 @@ RSpec.describe MergeRequestDiff do ]) end - context 'when sort_diffs feature flag is disabled' do - before do - stub_feature_flags(sort_diffs: false) - end - - it 'persists diff files unsorted by directory first' do - mr_diff = create(:merge_request).merge_request_diff - diff_files_paths = mr_diff.merge_request_diff_files.map { |file| file.new_path.presence || file.old_path } - - expect(diff_files_paths).to eq([ - '.DS_Store', - '.gitattributes', - '.gitignore', - '.gitmodules', - 'CHANGELOG', - 'README', - 'bar/branch-test.txt', - 'custom-highlighting/test.gitlab-custom', - 'encoding/iso8859.txt', - 'files/.DS_Store', - 'files/images/wm.svg', - 'files/js/commit.coffee', - 'files/lfs/lfs_object.iso', - 'files/ruby/popen.rb', - 'files/ruby/regex.rb', - 'files/whitespace', - 'foo/bar/.gitkeep', - 'gitlab-grack', - 'gitlab-shell', - 'with space/README.md' - ]) - end - end - it 'expands collapsed diffs before saving' do mr_diff = create(:merge_request, source_branch: 'expand-collapse-lines', target_branch: 'master').merge_request_diff diff_file = mr_diff.merge_request_diff_files.find_by(new_path: 'expand-collapse/file-5.txt') |