Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
a39cfb54
Commit
a39cfb54
authored
Aug 28, 2012
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify StubbedRepository after GitHost changes from master
parent
77d06454
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
22 deletions
+7
-22
spec/support/stubbed_repository.rb
spec/support/stubbed_repository.rb
+7
-22
No files found.
spec/support/stubbed_repository.rb
View file @
a39cfb54
...
...
@@ -9,34 +9,19 @@ module StubbedRepository
# will overwrite our stub, so use alias_method to ensure it's our stub
# getting called.
alias_method
:update_repository
,
:fake_update_repository
alias_method
:destroy_repository
,
:fake_destroy_repository
alias_method
:repository_delete_key
,
:fake_repository_delete_key
alias_method
:path_to_repo
,
:fake_path_to_repo
alias_method
:satellite
,
:fake_satellite
end
def
fake_update_repository
true
end
def
fake_destroy_repository
true
end
def
fake_repository_delete_key
true
alias_method
:path_to_repo
,
:fake_path_to_repo
alias_method
:satellite
,
:fake_satellite
end
def
fake_path_to_repo
if
new_record?
# There are a couple Project specs
that expect the Project's path to be
# in the returned path, so let's patronize them.
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.
File
.
join
(
Rails
.
root
,
'tmp'
,
'tests'
,
path
)
else
# For everything else, just give it the path to one of our real seeded
# repos.
File
.
join
(
Rails
.
root
,
'tmp'
,
'tests'
,
'gitlabhq_
1
'
)
File
.
join
(
Rails
.
root
,
'tmp'
,
'tests'
,
'gitlabhq_
0
'
)
end
end
...
...
@@ -55,6 +40,6 @@ module StubbedRepository
end
end
[
Project
,
Key
,
ProtectedBranch
,
UsersProject
].
each
do
|
c
|
[
Project
,
ProtectedBranch
,
UsersProject
].
each
do
|
c
|
c
.
send
(
:include
,
StubbedRepository
)
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment