summaryrefslogtreecommitdiff
path: root/features/support/env.rb
diff options
context:
space:
mode:
authorDan Knox <dknox@threedotloft.com>2013-03-10 14:37:26 -0700
committerDan Knox <dknox@threedotloft.com>2013-03-10 14:59:20 -0700
commit1479f1722702c955ed3ee9456107c6a1a7277c7b (patch)
tree9b5bbd1ac43a287f525b4a31e726990f53f59703 /features/support/env.rb
parentea9b3687db46bf876a6f966e61bfddc1e6d25ef3 (diff)
downloadgitlab-ce-1479f1722702c955ed3ee9456107c6a1a7277c7b.tar.gz
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.
Diffstat (limited to 'features/support/env.rb')
-rw-r--r--features/support/env.rb9
1 files changed, 9 insertions, 0 deletions
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