summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-04 08:43:25 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-04 08:43:25 +0200
commitdccd8b6eaa8b2e98b0245262a8e39df8fb8ae634 (patch)
tree541a40fb2e84b24ab0c4ae39fa18b1b720e5d7c2 /spec/support
parent39ba934c0a65f571214998e056e925b61f389360 (diff)
downloadgitlab-ce-dccd8b6eaa8b2e98b0245262a8e39df8fb8ae634.tar.gz
Continue refactoring. Use repostory and team
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/stubbed_repository.rb18
1 files changed, 6 insertions, 12 deletions
diff --git a/spec/support/stubbed_repository.rb b/spec/support/stubbed_repository.rb
index ad88dd77a4f..0e5628d05ff 100644
--- a/spec/support/stubbed_repository.rb
+++ b/spec/support/stubbed_repository.rb
@@ -1,18 +1,6 @@
# Stubs out all Git repository access done by models so that specs can run
# against fake repositories without Grit complaining that they don't exist.
class Project
- def path_to_repo
- if new_record? || path == 'newproject'
- # There are a couple Project specs and features that expect the Project's
- # path to be in the returned path, so let's patronize them.
- Rails.root.join('tmp', 'repositories', path)
- else
- # For everything else, just give it the path to one of our real seeded
- # repos.
- Rails.root.join('tmp', 'repositories', 'gitlabhq')
- end
- end
-
def satellite
FakeSatellite.new
end
@@ -27,3 +15,9 @@ class Project
end
end
end
+
+class Repository
+ def repo
+ @repo ||= Grit::Repo.new(Rails.root.join('tmp', 'repositories', 'gitlabhq'))
+ end
+end