diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-04 21:45:30 +0200 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-04 21:45:30 +0200 |
| commit | ef5b36eaaf92db19ae90cc599c3f64b865bdc4d5 (patch) | |
| tree | 4dd03fbf865b82a93cdec1f5d9d44c6b1d211d02 /spec/support | |
| parent | afbdbb0c959affbdb8725eafb8169025a8aede1e (diff) | |
| download | gitlab-ce-ef5b36eaaf92db19ae90cc599c3f64b865bdc4d5.tar.gz | |
Fixed protected branches and file edit
Diffstat (limited to 'spec/support')
| -rw-r--r-- | spec/support/stubbed_repository.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/support/stubbed_repository.rb b/spec/support/stubbed_repository.rb index 0e5628d05ff..e6e194d70f5 100644 --- a/spec/support/stubbed_repository.rb +++ b/spec/support/stubbed_repository.rb @@ -1,6 +1,17 @@ +require "repository" +require "project" + # 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 repository + if path == "empty" || !path + nil + else + GitLabTestRepo.new(path_with_namespace) + end + end + def satellite FakeSatellite.new end @@ -16,7 +27,7 @@ class Project end end -class Repository +class GitLabTestRepo < Repository def repo @repo ||= Grit::Repo.new(Rails.root.join('tmp', 'repositories', 'gitlabhq')) end |
