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,11 +24,11 @@ class Repository | ||
| 24 | end | 24 | end |
| 25 | 25 | ||
| 26 | def method_missing(m, *args, &block) | 26 | def method_missing(m, *args, &block) |
| 27 | - @raw_repository.send(m, *args, &block) | 27 | + raw_repository.send(m, *args, &block) |
| 28 | end | 28 | end |
| 29 | 29 | ||
| 30 | def respond_to?(method) | 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 | super | 33 | super |
| 34 | end | 34 | end |
spec/support/stubbed_repository.rb
| @@ -10,7 +10,7 @@ class Project | @@ -10,7 +10,7 @@ class Project | ||
| 10 | if path == "empty" || !path | 10 | if path == "empty" || !path |
| 11 | nil | 11 | nil |
| 12 | else | 12 | else |
| 13 | - GitLabTestRepo.new(path_with_namespace) | 13 | + GitLabTestRepo.new(Rails.root.join('tmp', 'repositories', 'gitlabhq'), 'master') |
| 14 | end | 14 | end |
| 15 | end | 15 | end |
| 16 | 16 | ||
| @@ -39,11 +39,7 @@ class MergeRequest | @@ -39,11 +39,7 @@ class MergeRequest | ||
| 39 | end | 39 | end |
| 40 | end | 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 | # patch repo size (in mb) | 43 | # patch repo size (in mb) |
| 48 | def size | 44 | def size |
| 49 | 12.45 | 45 | 12.45 |