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
7de8312d
Commit
7de8312d
authored
Mar 12, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed oauth_callback_url
parent
df232c27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
app/models/geo_node.rb
app/models/geo_node.rb
+4
-4
spec/models/geo_node_spec.rb
spec/models/geo_node_spec.rb
+9
-0
No files found.
app/models/geo_node.rb
View file @
7de8312d
...
...
@@ -56,6 +56,10 @@ class GeoNode < ActiveRecord::Base
URI
.
join
(
uri
,
"
#{
uri
.
path
}
/"
,
"api/
#{
API
::
API
.
version
}
/geo/refresh_projects"
).
to_s
end
def
oauth_callback_url
URI
.
join
(
uri
,
"
#{
uri
.
path
}
/"
,
'oauth/geo/callback'
).
to_s
end
def
missing_oauth_application?
self
.
primary?
?
false
:
!
oauth_application
.
present?
end
...
...
@@ -94,8 +98,4 @@ class GeoNode < ActiveRecord::Base
record
.
errors
[
:base
]
<<
'Current node must be the primary node or you will be locking yourself out'
end
end
def
oauth_callback_url
URI
.
join
(
uri
,
"
#{
uri
.
path
}
/"
,
'oauth'
,
'geo'
,
'callback'
).
to_s
end
end
spec/models/geo_node_spec.rb
View file @
7de8312d
...
...
@@ -155,6 +155,15 @@ describe GeoNode, type: :model do
end
end
describe
'#oauth_callback_url'
do
let
(
:oauth_callback_url
)
{
'https://localhost:3000/gitlab/oauth/geo/callback'
}
it
'returns oauth callback url based on node uri'
do
expect
(
new_node
.
oauth_callback_url
).
to
eq
(
oauth_callback_url
)
end
end
describe
'#missing_oauth_application?'
do
context
'on a primary node'
do
it
'returns false'
do
...
...
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