summaryrefslogtreecommitdiff
path: root/features/support
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-01 14:39:19 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-01 14:39:19 +0300
commit22817398e6c1cf9a479fecd99c55369fd81717cb (patch)
tree6c385da37d215a2d1de9fe25383da996fecc2d55 /features/support
parent7bb71bb088e17578482e7f934147b0fd11c7ad0e (diff)
downloadgitlab-ce-22817398e6c1cf9a479fecd99c55369fd81717cb.tar.gz
define TestEnv and keep all global stubs in one place
Diffstat (limited to 'features/support')
-rw-r--r--features/support/env.rb17
1 files changed, 3 insertions, 14 deletions
diff --git a/features/support/env.rb b/features/support/env.rb
index 90a61dd16c6..08b627f57b7 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -14,7 +14,7 @@ require 'spinach/capybara'
require 'sidekiq/testing/inline'
-%w(stubbed_repository valid_commit select2_helper).each do |f|
+%w(valid_commit select2_helper test_env).each do |f|
require Rails.root.join('spec', 'support', f)
end
@@ -35,13 +35,8 @@ Capybara.default_wait_time = 10
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
+ TestEnv.init
+
DatabaseCleaner.start
end
@@ -54,9 +49,3 @@ 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