Commit 4e9284a023f26e3dfd56a0130b8e2a38c884f0e6

Authored by Marin Jankovski
1 parent e16eb912

Clear state in test satellite dir.

Showing 2 changed files with 10 additions and 0 deletions   Show diff stats
spec/factories.rb
@@ -66,6 +66,7 @@ FactoryGirl.define do @@ -66,6 +66,7 @@ FactoryGirl.define do
66 66
67 after :create do |project| 67 after :create do |project|
68 TestEnv.clear_repo_dir(project.namespace, project.path) 68 TestEnv.clear_repo_dir(project.namespace, project.path)
  69 + TestEnv.reset_satellite_dir
69 TestEnv.create_repo(project.namespace, project.path) 70 TestEnv.create_repo(project.namespace, project.path)
70 end 71 end
71 end 72 end
spec/support/test_env.rb
@@ -97,6 +97,15 @@ module TestEnv @@ -97,6 +97,15 @@ module TestEnv
97 FileUtils.rm_rf File.join(testing_path(), "#{name}.wiki.git") 97 FileUtils.rm_rf File.join(testing_path(), "#{name}.wiki.git")
98 end 98 end
99 99
  100 + def reset_satellite_dir
  101 + setup_stubs
  102 + FileUtils.cd(seed_satellite_path) do
  103 + `git reset --hard --quiet`
  104 + `git clean -fx`
  105 + `git checkout --quiet origin/master`
  106 + end
  107 + end
  108 +
100 # Create a repo and it's satellite 109 # Create a repo and it's satellite
101 def create_repo(namespace, name) 110 def create_repo(namespace, name)
102 setup_stubs 111 setup_stubs