Add spec to prove that we don't create wiki when we update project's name

This commit is contained in:
Valery Sizov 2018-02-28 12:06:51 +02:00
parent 4497f829d8
commit 86de1e291c
1 changed files with 11 additions and 0 deletions

View File

@ -123,6 +123,17 @@ describe Projects::UpdateService do
end
end
context 'when we update project but not enabling a wiki' do
it 'does not try to create an empty wiki' do
FileUtils.rm_rf(project.wiki.repository.path)
result = update_project(project, user, { name: 'test1' })
expect(result).to eq({ status: :success })
expect(project.wiki_repository_exists?).to be false
end
end
context 'when enabling a wiki' do
it 'creates a wiki' do
project.project_feature.update(wiki_access_level: ProjectFeature::DISABLED)