Commit 1394ccfe authored by Jacob Vosmaer's avatar Jacob Vosmaer

Destroy wikis uniformly

parent fdf6ca6c
...@@ -12,7 +12,7 @@ describe RepositoryCheck::SingleRepositoryWorker do ...@@ -12,7 +12,7 @@ describe RepositoryCheck::SingleRepositoryWorker do
subject.perform(project.id) subject.perform(project.id)
expect(project.reload.last_repository_check_failed).to eq(false) expect(project.reload.last_repository_check_failed).to eq(false)
FileUtils.rm_rf(project.wiki.repository.path_to_repo) destroy_wiki(project)
subject.perform(project.id) subject.perform(project.id)
expect(project.reload.last_repository_check_failed).to eq(true) expect(project.reload.last_repository_check_failed).to eq(true)
...@@ -21,10 +21,14 @@ describe RepositoryCheck::SingleRepositoryWorker do ...@@ -21,10 +21,14 @@ describe RepositoryCheck::SingleRepositoryWorker do
it 'skips wikis when disabled' do it 'skips wikis when disabled' do
project = create(:project_empty_repo, wiki_enabled: false) project = create(:project_empty_repo, wiki_enabled: false)
# Make sure the test would fail if it checked the wiki repo # Make sure the test would fail if it checked the wiki repo
FileUtils.rm_rf(project.wiki.repository.path_to_repo) destroy_wiki(project)
subject.perform(project.id) subject.perform(project.id)
expect(project.reload.last_repository_check_failed).to eq(false) expect(project.reload.last_repository_check_failed).to eq(false)
end end
def destroy_wiki(project)
FileUtils.rm_rf(project.wiki.repository.path_to_repo)
end
end end
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