diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-23 21:12:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-23 21:12:49 +0300 |
commit | fee19ef336bc64155e0d9e8697834ff529bb6d93 (patch) | |
tree | 44495c315182e298b14b0a440071d2b91a7b7c91 /spec/models | |
parent | 0e6ce73070a9816db513ba360620699232c517d7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/commit_spec.rb | 62 | ||||
-rw-r--r-- | spec/models/merge_request_spec.rb | 2 |
2 files changed, 7 insertions, 57 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index ac0ae17f8f7..2176eea75bc 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -676,68 +676,18 @@ eos describe '.diff_max_files' do subject(:diff_max_files) { described_class.diff_max_files } - let(:increased_diff_limits) { false } - let(:configurable_diff_limits) { false } - - before do - stub_feature_flags(increased_diff_limits: increased_diff_limits, configurable_diff_limits: configurable_diff_limits) - end - - context 'when increased_diff_limits is enabled' do - let(:increased_diff_limits) { true } - - it 'returns 3000' do - expect(diff_max_files).to eq(3000) - end - end - - context 'when configurable_diff_limits is enabled' do - let(:configurable_diff_limits) { true } - - it 'returns the current settings' do - Gitlab::CurrentSettings.update!(diff_max_files: 1234) - expect(diff_max_files).to eq(1234) - end - end - - context 'when neither feature flag is enabled' do - it 'returns 1000' do - expect(diff_max_files).to eq(1000) - end + it 'returns the current settings' do + Gitlab::CurrentSettings.update!(diff_max_files: 1234) + expect(diff_max_files).to eq(1234) end end describe '.diff_max_lines' do subject(:diff_max_lines) { described_class.diff_max_lines } - let(:increased_diff_limits) { false } - let(:configurable_diff_limits) { false } - - before do - stub_feature_flags(increased_diff_limits: increased_diff_limits, configurable_diff_limits: configurable_diff_limits) - end - - context 'when increased_diff_limits is enabled' do - let(:increased_diff_limits) { true } - - it 'returns 100000' do - expect(diff_max_lines).to eq(100000) - end - end - - context 'when configurable_diff_limits is enabled' do - let(:configurable_diff_limits) { true } - - it 'returns the current settings' do - Gitlab::CurrentSettings.update!(diff_max_lines: 65321) - expect(diff_max_lines).to eq(65321) - end - end - - context 'when neither feature flag is enabled' do - it 'returns 50000' do - expect(diff_max_lines).to eq(50000) - end + it 'returns the current settings' do + Gitlab::CurrentSettings.update!(diff_max_lines: 65321) + expect(diff_max_lines).to eq(65321) end end diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index 5618fb06157..92ef9aeb2d8 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -1132,7 +1132,7 @@ RSpec.describe MergeRequest, factory_default: :keep do end it 'returns the correct overflow count' do - allow(Commit).to receive(:max_diff_options).and_return(max_files: 2) + allow(Commit).to receive(:diff_max_files).and_return(2) set_compare(merge_request) expect(merge_request.diff_size).to eq('2+') |