Continue refactoring. Use repostory and team
This commit is contained in:
parent
39ba934c0a
commit
dccd8b6eaa
42 changed files with 219 additions and 179 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue