From 1479f1722702c955ed3ee9456107c6a1a7277c7b Mon Sep 17 00:00:00 2001 From: Dan Knox Date: Sun, 10 Mar 2013 14:37:26 -0700 Subject: Add Spinach coverage for Gollum Wiki system and correct the Delete link. The previously failing Spinach steps have been fixed with this commit. I have also added new steps that cover the entire usage of the Wiki system. The new Spinach steps revealed a minor bug in the Delete page process. The path for the "Delete this page" button was previously set to `project_wikis_page(@project, @wiki)` when it should have been using the singular `project_wiki_page(@project, @wiki)` path helper. The link has been corrected and all steps are now passing. --- features/support/env.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'features/support') diff --git a/features/support/env.rb b/features/support/env.rb index 2fd7ffdb813..b83f0d12357 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -32,6 +32,9 @@ DatabaseCleaner.strategy = :truncation Spinach.hooks.before_scenario do # Use tmp dir for FS manipulations Gitlab.config.gitlab_shell.stub(repos_path: Rails.root.join('tmp', 'test-git-base-path')) + Gitlab::Shell.any_instance.stub(:add_repository) do |path| + create_temp_repo("#{Rails.root}/tmp/test-git-base-path/#{path}.git") + end FileUtils.rm_rf Gitlab.config.gitlab_shell.repos_path FileUtils.mkdir_p Gitlab.config.gitlab_shell.repos_path DatabaseCleaner.start @@ -46,3 +49,9 @@ Spinach.hooks.before_run do include FactoryGirl::Syntax::Methods end + +def create_temp_repo(path) + FileUtils.mkdir_p path + command = "git init --quiet --bare #{path};" + system(command) +end -- cgit v1.2.1