diff options
author | Nick Thomas <nick@gitlab.com> | 2017-08-17 11:15:57 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-08-17 11:30:07 +0100 |
commit | 0de85b53194f582e8fc3267f14b7a5038440e401 (patch) | |
tree | 082124f1e8907ff0b9b3b26d2d4870d286e27599 /spec/models | |
parent | db3289be55f5efe7523d2e8119f549b93c140b92 (diff) | |
download | gitlab-ce-0de85b53194f582e8fc3267f14b7a5038440e401.tar.gz |
Remove a wat in NamespacelessProjectDestroyWorker
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index eba71ba2f72..361a4c022ca 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -2311,6 +2311,29 @@ describe Project do end end + describe '#remove_pages' do + let(:project) { create(:project) } + let(:pages_path) { project.pages_path } + + around do |example| + FileUtils.mkdir_p(pages_path) + begin + example.run + ensure + FileUtils.rm_rf(pages_path) + end + end + + it 'is a no-op when there is no namespace' do + project.update_column(:namespace_id, nil) + + expect_any_instance_of(Projects::UpdatePagesConfigurationService).not_to receive(:execute) + expect_any_instance_of(Gitlab::PagesTransfer).not_to receive(:rename_project) + + project.remove_pages + end + end + describe '#forks_count' do it 'returns the number of forks' do project = build(:project) |