Clear state in test satellite dir.

This commit is contained in:
Marin Jankovski 2013-11-12 15:11:46 +01:00
parent e16eb91299
commit 4e9284a023
2 changed files with 10 additions and 0 deletions

View file

@ -66,6 +66,7 @@ FactoryGirl.define do
after :create do |project|
TestEnv.clear_repo_dir(project.namespace, project.path)
TestEnv.reset_satellite_dir
TestEnv.create_repo(project.namespace, project.path)
end
end

View file

@ -97,6 +97,15 @@ module TestEnv
FileUtils.rm_rf File.join(testing_path(), "#{name}.wiki.git")
end
def reset_satellite_dir
setup_stubs
FileUtils.cd(seed_satellite_path) do
`git reset --hard --quiet`
`git clean -fx`
`git checkout --quiet origin/master`
end
end
# Create a repo and it's satellite
def create_repo(namespace, name)
setup_stubs