From 22817398e6c1cf9a479fecd99c55369fd81717cb Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 1 Apr 2013 14:39:19 +0300 Subject: define TestEnv and keep all global stubs in one place --- features/support/env.rb | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'features/support') 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 -- cgit v1.2.1