Commit 7bb71bb088e17578482e7f934147b0fd11c7ad0e
1 parent
458631c5
Exists in
master
and in
4 other branches
Fix stubbed repo
Showing
2 changed files
with
4 additions
and
8 deletions
Show diff stats
app/models/repository.rb
| ... | ... | @@ -24,11 +24,11 @@ class Repository |
| 24 | 24 | end |
| 25 | 25 | |
| 26 | 26 | def method_missing(m, *args, &block) |
| 27 | - @raw_repository.send(m, *args, &block) | |
| 27 | + raw_repository.send(m, *args, &block) | |
| 28 | 28 | end |
| 29 | 29 | |
| 30 | 30 | def respond_to?(method) |
| 31 | - return true if @raw_repository.respond_to?(method) | |
| 31 | + return true if raw_repository.respond_to?(method) | |
| 32 | 32 | |
| 33 | 33 | super |
| 34 | 34 | end | ... | ... |
spec/support/stubbed_repository.rb
| ... | ... | @@ -10,7 +10,7 @@ class Project |
| 10 | 10 | if path == "empty" || !path |
| 11 | 11 | nil |
| 12 | 12 | else |
| 13 | - GitLabTestRepo.new(path_with_namespace) | |
| 13 | + GitLabTestRepo.new(Rails.root.join('tmp', 'repositories', 'gitlabhq'), 'master') | |
| 14 | 14 | end |
| 15 | 15 | end |
| 16 | 16 | |
| ... | ... | @@ -39,11 +39,7 @@ class MergeRequest |
| 39 | 39 | end |
| 40 | 40 | end |
| 41 | 41 | |
| 42 | -class GitLabTestRepo < Gitlab::Git::Repository | |
| 43 | - def repo | |
| 44 | - @repo ||= Grit::Repo.new(Rails.root.join('tmp', 'repositories', 'gitlabhq')) | |
| 45 | - end | |
| 46 | - | |
| 42 | +class GitLabTestRepo < Repository | |
| 47 | 43 | # patch repo size (in mb) |
| 48 | 44 | def size |
| 49 | 45 | 12.45 | ... | ... |