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
4bbe48cb
Commit
4bbe48cb
authored
Mar 07, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs for GeoNode
parent
387877d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
app/models/geo_node.rb
app/models/geo_node.rb
+3
-3
spec/factories.rb
spec/factories.rb
+18
-0
No files found.
app/models/geo_node.rb
View file @
4bbe48cb
...
...
@@ -33,7 +33,7 @@ class GeoNode < ActiveRecord::Base
def
uri
if
relative_url_root
relative_url
=
relative_url_root
.
starts_with?
(
'/'
)
?
relative_url_root
:
relative_url_root
.
prepend
(
'/'
)
relative_url
=
relative_url_root
.
starts_with?
(
'/'
)
?
relative_url_root
:
"/
#{
relative_url_root
}
"
end
URI
.
parse
(
URI
::
Generic
.
build
(
scheme:
schema
,
host:
host
,
port:
port
,
path:
relative_url
).
normalize
.
to_s
)
...
...
@@ -59,9 +59,9 @@ class GeoNode < ActiveRecord::Base
def
refresh_bulk_notify_worker_status
if
Gitlab
::
Geo
.
primary?
Gitlab
::
Geo
.
bulk_notify_job
.
enable!
Gitlab
::
Geo
.
bulk_notify_job
.
try
(
:enable!
)
else
Gitlab
::
Geo
.
bulk_notify_job
.
disable!
Gitlab
::
Geo
.
bulk_notify_job
.
try
(
:disable!
)
end
end
...
...
spec/factories.rb
View file @
4bbe48cb
...
...
@@ -116,6 +116,12 @@ FactoryGirl.define do
end
factory
:geo_node_key
,
class:
'GeoNodeKey'
do
trait
:another_key
do
key
do
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDmTillFzNTrrGgwaCKaSj+QCz81E6jBc/s9av0+3b1Hwfxgkqjl4nAK/OD2NjgyrONDTDfR8cRN4eAAy6nY8GLkOyYBDyuc5nTMqs5z3yVuTwf3koGm/YQQCmo91psZ2BgDFTor8SVEE5Mm1D1k3JDMhDFxzzrOtRYFPci9lskTJaBjpqWZ4E9rDTD2q/QZntCqbC3wE9uSemRQB5f8kik7vD/AD8VQXuzKladrZKkzkONCPWsXDspUitjM8HkQdOf0PsYn1CMUC1xKYbCxkg5TkEosIwGv6CoEArUrdu/4+10LVslq494mAvEItywzrluCLCnwELfW+h/m8UHoVhZ"
end
end
end
factory
:personal_key
do
...
...
@@ -230,4 +236,16 @@ FactoryGirl.define do
noteable
factory: :issue
reply_key
"0123456789abcdef"
*
2
end
factory
:geo_node
do
host
{
Gitlab
.
config
.
gitlab
.
host
}
sequence
(
:port
)
{
|
n
|
n
}
association
:geo_node_key
trait
:primary
do
primary
true
port
{
Gitlab
.
config
.
gitlab
.
port
}
association
:geo_node_key
,
:another_key
end
end
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