summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/checks/lfs_check_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/checks/lfs_check_spec.rb')
-rw-r--r--spec/lib/gitlab/checks/lfs_check_spec.rb23
1 files changed, 18 insertions, 5 deletions
diff --git a/spec/lib/gitlab/checks/lfs_check_spec.rb b/spec/lib/gitlab/checks/lfs_check_spec.rb
index 713858e0e35..19c1d820dff 100644
--- a/spec/lib/gitlab/checks/lfs_check_spec.rb
+++ b/spec/lib/gitlab/checks/lfs_check_spec.rb
@@ -39,13 +39,26 @@ RSpec.describe Gitlab::Checks::LfsCheck do
end
end
- context 'deletion' do
- let(:changes) { { oldrev: oldrev, ref: ref } }
+ context 'with deletion' do
+ shared_examples 'a skipped integrity check' do
+ it 'skips integrity check' do
+ expect(project.repository).not_to receive(:new_objects)
+ expect_any_instance_of(Gitlab::Git::LfsChanges).not_to receive(:new_pointers)
+
+ subject.validate!
+ end
+ end
- it 'skips integrity check' do
- expect(project.repository).not_to receive(:new_objects)
+ context 'with missing newrev' do
+ it_behaves_like 'a skipped integrity check' do
+ let(:changes) { { oldrev: oldrev, ref: ref } }
+ end
+ end
- subject.validate!
+ context 'with blank newrev' do
+ it_behaves_like 'a skipped integrity check' do
+ let(:changes) { { oldrev: oldrev, newrev: Gitlab::Git::BLANK_SHA, ref: ref } }
+ end
end
end