diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-04-18 12:03:53 +0300 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-04-18 12:03:53 +0300 |
commit | 1394ccfe834c4e34bed701d206c77961a594fa23 (patch) | |
tree | f471b57b8868cc5fd590d9dce4a379b46d1956ec /spec/workers/repository_check | |
parent | fdf6ca6c01ec54bf86ee72d5adbaf4ae3cff8483 (diff) |
Destroy wikis uniformly
Diffstat (limited to 'spec/workers/repository_check')
-rw-r--r-- | spec/workers/repository_check/single_repository_worker_spec.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/workers/repository_check/single_repository_worker_spec.rb b/spec/workers/repository_check/single_repository_worker_spec.rb index 3179dd70b0a..087e4c667d8 100644 --- a/spec/workers/repository_check/single_repository_worker_spec.rb +++ b/spec/workers/repository_check/single_repository_worker_spec.rb @@ -12,7 +12,7 @@ describe RepositoryCheck::SingleRepositoryWorker do subject.perform(project.id) 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) expect(project.reload.last_repository_check_failed).to eq(true) @@ -21,10 +21,14 @@ describe RepositoryCheck::SingleRepositoryWorker do it 'skips wikis when disabled' do project = create(:project_empty_repo, wiki_enabled: false) # 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) expect(project.reload.last_repository_check_failed).to eq(false) end + + def destroy_wiki(project) + FileUtils.rm_rf(project.wiki.repository.path_to_repo) + end end |