2017-08-24 21:30:12 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Gitlab::Git::LfsChanges do
|
2018-06-19 09:57:27 -04:00
|
|
|
set(:project) { create(:project, :repository) }
|
2017-08-24 21:30:12 -04:00
|
|
|
let(:newrev) { '54fcc214b94e78d7a41a9a8fe6d87a5e59500e51' }
|
|
|
|
let(:blob_object_id) { '0c304a93cb8430108629bbbcaa27db3343299bc0' }
|
|
|
|
|
|
|
|
subject { described_class.new(project.repository, newrev) }
|
|
|
|
|
2018-02-06 17:49:33 -05:00
|
|
|
describe '#new_pointers' do
|
2018-06-19 09:57:27 -04:00
|
|
|
it 'filters new objects to find lfs pointers' do
|
|
|
|
expect(subject.new_pointers(not_in: []).first.id).to eq(blob_object_id)
|
2017-08-24 21:30:12 -04:00
|
|
|
end
|
|
|
|
|
2018-06-19 09:57:27 -04:00
|
|
|
it 'limits new_objects using object_limit' do
|
|
|
|
expect(subject.new_pointers(object_limit: 1)).to eq([])
|
2017-08-24 21:30:12 -04:00
|
|
|
end
|
2018-10-22 10:49:20 -04:00
|
|
|
|
|
|
|
it 'times out if given a small dynamic timeout' do
|
|
|
|
expect { subject.new_pointers(dynamic_timeout: 0.001) }.to raise_error(GRPC::DeadlineExceeded)
|
|
|
|
end
|
2017-08-24 21:30:12 -04:00
|
|
|
end
|
|
|
|
end
|