debian-mirror-gitlab/spec/lib/gitlab/git/lfs_changes_spec.rb

27 lines
814 B
Ruby
Raw Normal View History

2020-01-01 13:55:28 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe Gitlab::Git::LfsChanges do
2020-04-08 14:13:33 +05:30
let_it_be(:project) { create(:project, :repository) }
2021-06-08 01:23:25 +05:30
2018-03-17 18:26:18 +05:30
let(:newrev) { '54fcc214b94e78d7a41a9a8fe6d87a5e59500e51' }
let(:blob_object_id) { '0c304a93cb8430108629bbbcaa27db3343299bc0' }
subject { described_class.new(project.repository, newrev) }
2018-03-27 19:54:05 +05:30
describe '#new_pointers' do
2018-11-08 19:23:39 +05:30
it 'filters new objects to find lfs pointers' do
expect(subject.new_pointers(not_in: []).first.id).to eq(blob_object_id)
2018-03-17 18:26:18 +05:30
end
2018-11-08 19:23:39 +05:30
it 'limits new_objects using object_limit' do
expect(subject.new_pointers(object_limit: 1)).to eq([])
2018-03-17 18:26:18 +05:30
end
2018-12-13 13:39:08 +05:30
it 'times out if given a small dynamic timeout' do
expect { subject.new_pointers(dynamic_timeout: 0.001) }.to raise_error(GRPC::DeadlineExceeded)
end
2018-03-17 18:26:18 +05:30
end
end