diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2018-06-06 19:42:18 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-06-06 19:42:18 +0300 |
commit | e8f49b4bee8d803953b852685889a2912609ae84 (patch) | |
tree | fdbef6fc26ebc49be27e1553ea980cb734b8ab7d /spec/lib/gitlab/import_sources_spec.rb | |
parent | 0dd7563b7c91141f545432e9082906ebb196a38d (diff) |
Support LFS objects when creating a project by import
Diffstat (limited to 'spec/lib/gitlab/import_sources_spec.rb')
-rw-r--r-- | spec/lib/gitlab/import_sources_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/lib/gitlab/import_sources_spec.rb b/spec/lib/gitlab/import_sources_spec.rb index f2fa315e3ec..10341486512 100644 --- a/spec/lib/gitlab/import_sources_spec.rb +++ b/spec/lib/gitlab/import_sources_spec.rb @@ -91,4 +91,23 @@ describe Gitlab::ImportSources do end end end + + describe 'imports_repository? checker' do + let(:allowed_importers) { %w[github gitlab_project] } + + it 'fails if any importer other than the allowed ones implements this method' do + current_importers = described_class.values.select { |kind| described_class.importer(kind).try(:imports_repository?) } + not_allowed_importers = current_importers - allowed_importers + + expect(not_allowed_importers).to be_empty, failure_message(not_allowed_importers) + end + + def failure_message(importers_class_names) + <<-MSG + It looks like the #{importers_class_names.join(', ')} importers implements its own way to import the repository. + That means that the lfs object download must be handled for each of them. You can use 'LfsImportService' and + 'LfsDownloadService' to implement it. After that, add the importer name to the list of allowed importers in this spec. + MSG + end + end end |