summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-07 00:09:33 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-07 00:09:33 +0000
commitb56027c9d80ac0e297ba8a43c81e8504172dbf9f (patch)
treeb85f743277145e930ae195664655d696e6e0a7fc /spec/models
parent7915c41e4261719719e791602c8235574157164c (diff)
downloadgitlab-ce-b56027c9d80ac0e297ba8a43c81e8504172dbf9f.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/snippet_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb
index 8ce3718e3c1..9cced1f24ab 100644
--- a/spec/models/snippet_spec.rb
+++ b/spec/models/snippet_spec.rb
@@ -696,6 +696,23 @@ describe Snippet do
end
end
+ describe '#repository_size_checker' do
+ subject { build(:personal_snippet) }
+
+ let(:checker) { subject.repository_size_checker }
+ let(:current_size) { 60 }
+
+ before do
+ allow(subject.repository).to receive(:_uncached_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
+ end
+
describe '#can_cache_field?' do
using RSpec::Parameterized::TableSyntax