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 66  
67 67 after :create do |project|
68 68 TestEnv.clear_repo_dir(project.namespace, project.path)
  69 + TestEnv.reset_satellite_dir
69 70 TestEnv.create_repo(project.namespace, project.path)
70 71 end
71 72 end
... ...
spec/support/test_env.rb
... ... @@ -97,6 +97,15 @@ module TestEnv
97 97 FileUtils.rm_rf File.join(testing_path(), "#{name}.wiki.git")
98 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 109 # Create a repo and it's satellite
101 110 def create_repo(namespace, name)
102 111 setup_stubs
... ...