summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/github_import/importer/lfs_object_importer_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/github_import/importer/lfs_object_importer_spec.rb')
-rw-r--r--spec/lib/gitlab/github_import/importer/lfs_object_importer_spec.rb22
1 files changed, 14 insertions, 8 deletions
diff --git a/spec/lib/gitlab/github_import/importer/lfs_object_importer_spec.rb b/spec/lib/gitlab/github_import/importer/lfs_object_importer_spec.rb
index 4857f2afbe2..8fd328d9c1e 100644
--- a/spec/lib/gitlab/github_import/importer/lfs_object_importer_spec.rb
+++ b/spec/lib/gitlab/github_import/importer/lfs_object_importer_spec.rb
@@ -2,20 +2,26 @@ require 'spec_helper'
describe Gitlab::GithubImport::Importer::LfsObjectImporter do
let(:project) { create(:project) }
- let(:download_link) { "http://www.gitlab.com/lfs_objects/oid" }
-
- let(:github_lfs_object) do
- Gitlab::GithubImport::Representation::LfsObject.new(
- oid: 'oid', download_link: download_link
- )
+ let(:lfs_attributes) do
+ {
+ oid: 'oid',
+ size: 1,
+ link: 'http://www.gitlab.com/lfs_objects/oid'
+ }
end
+ let(:lfs_download_object) { LfsDownloadObject.new(lfs_attributes) }
+ let(:github_lfs_object) { Gitlab::GithubImport::Representation::LfsObject.new(lfs_attributes) }
+
let(:importer) { described_class.new(github_lfs_object, project, nil) }
describe '#execute' do
it 'calls the LfsDownloadService with the lfs object attributes' do
- expect_any_instance_of(Projects::LfsPointers::LfsDownloadService)
- .to receive(:execute).with('oid', download_link)
+ allow(importer).to receive(:lfs_download_object).and_return(lfs_download_object)
+
+ service = double
+ expect(Projects::LfsPointers::LfsDownloadService).to receive(:new).with(project, lfs_download_object).and_return(service)
+ expect(service).to receive(:execute)
importer.execute
end