summaryrefslogtreecommitdiff
path: root/spec/models/snippet_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/snippet_spec.rb')
-rw-r--r--spec/models/snippet_spec.rb17
1 files changed, 3 insertions, 14 deletions
diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb
index ab614a6d45c..d74f5faab7f 100644
--- a/spec/models/snippet_spec.rb
+++ b/spec/models/snippet_spec.rb
@@ -666,16 +666,13 @@ RSpec.describe Snippet do
let(:checker) { subject.repository_size_checker }
let(:current_size) { 60 }
+ let(:namespace) { nil }
before do
allow(subject.repository).to receive(:size).and_return(current_size)
end
- it 'sets up size checker', :aggregate_failures do
- expect(checker.current_size).to eq(current_size.megabytes)
- expect(checker.limit).to eq(Gitlab::CurrentSettings.snippet_size_limit)
- expect(checker.enabled?).to be_truthy
- end
+ include_examples 'size checker for snippet'
end
describe '#can_cache_field?' do
@@ -717,19 +714,11 @@ RSpec.describe Snippet do
end
describe '.max_file_limit' do
- subject { described_class.max_file_limit(nil) }
+ subject { described_class.max_file_limit }
it "returns #{Snippet::MAX_FILE_COUNT}" do
expect(subject).to eq Snippet::MAX_FILE_COUNT
end
-
- context 'when feature flag :snippet_multiple_files is disabled' do
- it "returns #{described_class::MAX_SINGLE_FILE_COUNT}" do
- stub_feature_flags(snippet_multiple_files: false)
-
- expect(subject).to eq described_class::MAX_SINGLE_FILE_COUNT
- end
- end
end
describe '#list_files' do