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
29de1916
Commit
29de1916
authored
Feb 18, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GeoNode notify and add specs
parent
e1f14449
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
1 deletion
+54
-1
app/models/geo_node.rb
app/models/geo_node.rb
+1
-1
spec/models/geo_node_spec.rb
spec/models/geo_node_spec.rb
+53
-0
No files found.
app/models/geo_node.rb
View file @
29de1916
...
...
@@ -29,6 +29,6 @@ class GeoNode < ActiveRecord::Base
end
def
notify_url
URI
::
join
(
uri
,
'/
api/geo/refresh_projects'
).
to_s
URI
::
join
(
uri
,
"
#{
uri
.
path
}
/"
,
'
api/geo/refresh_projects'
).
to_s
end
end
spec/models/geo_node_spec.rb
0 → 100644
View file @
29de1916
require
'spec_helper'
describe
GeoNode
,
type: :model
do
context
'default values'
do
it
'defines a default schema'
do
expect
(
subject
.
schema
).
to
eq
(
'http'
)
end
it
'defines a default port'
do
expect
(
subject
.
port
).
to
eq
(
80
)
end
it
'defines a default primary flag'
do
expect
(
subject
.
primary
).
to
eq
(
false
)
end
end
describe
'#uri'
do
subject
{
GeoNode
.
new
(
schema:
'https'
,
host:
'localhost'
,
port:
3000
,
relative_url_root:
'gitlab'
)
}
it
'returns an URI object'
do
expect
(
subject
.
uri
).
to
be_a
URI
end
it
'includes schema home port and relative_url'
do
expected_uri
=
URI
.
parse
(
'https://localhost:3000/gitlab'
)
expect
(
subject
.
uri
).
to
eq
(
expected_uri
)
end
end
describe
'#url'
do
subject
{
GeoNode
.
new
(
schema:
'https'
,
host:
'localhost'
,
port:
3000
,
relative_url_root:
'gitlab'
)
}
it
'returns a string'
do
expect
(
subject
.
url
).
to
be_a
String
end
it
'includes schema home port and relative_url'
do
expected_url
=
'https://localhost:3000/gitlab'
expect
(
subject
.
url
).
to
eq
(
expected_url
)
end
end
describe
'#notify_url'
do
subject
{
GeoNode
.
new
(
schema:
'https'
,
host:
'localhost'
,
port:
3000
,
relative_url_root:
'gitlab'
)
}
it
'returns api url based on node uri'
do
expect
(
subject
.
notify_url
).
to
eq
(
'https://localhost:3000/gitlab/api/geo/refresh_projects'
)
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