Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-23 21:12:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-23 21:12:49 +0300
commitfee19ef336bc64155e0d9e8697834ff529bb6d93 (patch)
tree44495c315182e298b14b0a440071d2b91a7b7c91 /spec/models
parent0e6ce73070a9816db513ba360620699232c517d7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/commit_spec.rb62
-rw-r--r--spec/models/merge_request_spec.rb2
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+')