diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-10-25 16:43:24 -0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-05-26 15:52:15 -0700 |
commit | e76a30c74bda205e79cd9ac738079428f1a6c436 (patch) | |
tree | 200e00b35e35b885886c089e40c7b32800a69d2c /spec | |
parent | bd259d6bab4b3c9856be6c3d2e0c16e0836c9380 (diff) | |
download | gitlab-ce-e76a30c74bda205e79cd9ac738079428f1a6c436.tar.gz |
Add missing project import job example from gitlab-ee
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/project_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index f2b4e9070b4..2075d7199a1 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1431,6 +1431,26 @@ describe Project, models: true do end end + describe 'Project import job' do + let(:project) { create(:empty_project) } + let(:mirror) { false } + + before do + allow_any_instance_of(Gitlab::Shell).to receive(:import_repository).with(project.repository_storage_path, project.path_with_namespace, project.import_url).and_return(true) + allow(project).to receive(:repository_exists?).and_return(true) + allow_any_instance_of(Repository).to receive(:build_cache).and_return(true) + end + + it 'imports a project' do + expect_any_instance_of(RepositoryImportWorker).to receive(:perform).and_call_original + + project.import_start + project.add_import_job + + expect(project.reload.import_status).to eq('finished') + end + end + describe '#latest_successful_builds_for' do def create_pipeline(status = 'success') create(:ci_pipeline, project: project, |