Commit 45b2d0f6 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Geo: Don't create the project when it's being imported

parent 8a318984
......@@ -6,6 +6,6 @@ class GeoRepositoryCreateWorker
project = Project.find(id)
project.ensure_dir_exist
project.create_repository unless project.repository_exists?
project.create_repository unless project.repository_exists? || project.import?
end
end
......@@ -15,6 +15,13 @@ describe GeoRepositoryCreateWorker do
perform!
end
it 'does not create the repository when its being imported' do
expect(project).to receive(:import?) { true }
expect(project).not_to receive(:create_repository)
perform!
end
end
context 'when repository exists' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment