diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-04 08:43:25 +0200 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-04 08:43:25 +0200 |
| commit | dccd8b6eaa8b2e98b0245262a8e39df8fb8ae634 (patch) | |
| tree | 541a40fb2e84b24ab0c4ae39fa18b1b720e5d7c2 /spec/support | |
| parent | 39ba934c0a65f571214998e056e925b61f389360 (diff) | |
| download | gitlab-ce-dccd8b6eaa8b2e98b0245262a8e39df8fb8ae634.tar.gz | |
Continue refactoring. Use repostory and team
Diffstat (limited to 'spec/support')
| -rw-r--r-- | spec/support/stubbed_repository.rb | 18 |
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 |
