diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-09-29 10:04:50 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-07 11:46:23 +0200 |
commit | e8ca579d88703aeeaa64dbf4ac45f73a60181568 (patch) | |
tree | 7b162a264c764f58df8f9a5cadf49da5465180cc /spec/workers | |
parent | 7c00b53812895970fdb00cf1d27b059bb15815cd (diff) | |
download | gitlab-ce-e8ca579d88703aeeaa64dbf4ac45f73a60181568.tar.gz |
Add a project forks spec helper
The helper creates a fork of a project with all provided attributes,
but skipping the creation of the repository on disk.
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/namespaceless_project_destroy_worker_spec.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/workers/namespaceless_project_destroy_worker_spec.rb b/spec/workers/namespaceless_project_destroy_worker_spec.rb index 20cf580af8a..ed8cedc0079 100644 --- a/spec/workers/namespaceless_project_destroy_worker_spec.rb +++ b/spec/workers/namespaceless_project_destroy_worker_spec.rb @@ -1,6 +1,8 @@ require 'spec_helper' describe NamespacelessProjectDestroyWorker do + include ProjectForksHelper + subject { described_class.new } before do @@ -55,9 +57,11 @@ describe NamespacelessProjectDestroyWorker do context 'project forked from another' do let!(:parent_project) { create(:project) } - - before do - create(:forked_project_link, forked_to_project: project, forked_from_project: parent_project) + let(:project) do + namespaceless_project = fork_project(parent_project) + namespaceless_project.namespace_id = nil + namespaceless_project.save(validate: false) + namespaceless_project end it 'closes open merge requests' do |