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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
fae25980
Commit
fae25980
authored
Jun 27, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ProjectWiki#ensure_repository
parent
9f06eb37
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
app/models/project_wiki.rb
app/models/project_wiki.rb
+4
-0
app/services/geo/repository_sync_service.rb
app/services/geo/repository_sync_service.rb
+1
-1
spec/models/project_wiki_spec.rb
spec/models/project_wiki_spec.rb
+18
-0
No files found.
app/models/project_wiki.rb
View file @
fae25980
...
...
@@ -162,6 +162,10 @@ class ProjectWiki
wiki
end
def
ensure_repository
create_repo!
unless
repository_exists?
end
def
hook_attrs
{
web_url:
web_url
,
...
...
app/services/geo/repository_sync_service.rb
View file @
fae25980
...
...
@@ -88,7 +88,7 @@ module Geo
finished_at
=
nil
begin
project
.
wiki
.
create_repo!
unless
project
.
wiki
.
repository_exists?
project
.
wiki
.
ensure_repository
project
.
wiki
.
repository
.
fetch_geo_mirror
(
ssh_url_to_wiki
)
finished_at
=
DateTime
.
now
...
...
spec/models/project_wiki_spec.rb
View file @
fae25980
...
...
@@ -286,6 +286,24 @@ describe ProjectWiki, models: true do
end
end
describe
'#ensure_repository'
do
it
'creates the repository if it not exist'
do
allow
(
subject
).
to
receive
(
:repository_exists?
).
and_return
(
false
)
expect
(
subject
).
to
receive
(
:create_repo!
)
subject
.
ensure_repository
end
it
'does not create the repository if it exists'
do
allow
(
subject
).
to
receive
(
:repository_exists?
).
and_return
(
true
)
expect
(
subject
).
not_to
receive
(
:create_repo!
)
subject
.
ensure_repository
end
end
describe
'#hook_attrs'
do
it
'returns a hash with values'
do
expect
(
subject
.
hook_attrs
).
to
be_a
Hash
...
...
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