diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-04-30 09:54:41 +0100 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-04-30 09:54:44 +0100 |
commit | f250fb1672ee58ae9e50b83425cdbf7c52cc078c (patch) | |
tree | 2393ffd02d2e1b652863822ae99e0b46c72ba414 /spec/workers | |
parent | 507e3fbca30441983322c37408988b6a49f0acc5 (diff) | |
download | gitlab-ce-f250fb1672ee58ae9e50b83425cdbf7c52cc078c.tar.gz |
Makes namespaceless project destroy worker spec not depend on a specific migration version
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/namespaceless_project_destroy_worker_spec.rb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/spec/workers/namespaceless_project_destroy_worker_spec.rb b/spec/workers/namespaceless_project_destroy_worker_spec.rb index 479d9396eca..eec110dfbfb 100644 --- a/spec/workers/namespaceless_project_destroy_worker_spec.rb +++ b/spec/workers/namespaceless_project_destroy_worker_spec.rb @@ -22,13 +22,11 @@ describe NamespacelessProjectDestroyWorker do end end - # Only possible with schema 20180222043024 and lower. - # Project#namespace_id has not null constraint since then - context 'project has no namespace', :migration, schema: 20180222043024 do - let!(:project) do - project = build(:project, namespace_id: nil) - project.save(validate: false) - project + context 'project has no namespace' do + let!(:project) { create(:project) } + + before do + allow_any_instance_of(Project).to receive(:namespace).and_return(nil) end context 'project not a fork of another project' do @@ -61,8 +59,7 @@ describe NamespacelessProjectDestroyWorker do let!(:parent_project) { create(:project) } let(:project) do namespaceless_project = fork_project(parent_project) - namespaceless_project.namespace_id = nil - namespaceless_project.save(validate: false) + namespaceless_project.save namespaceless_project end |