Commit edc7acbc authored by Gabriel Mazetto's avatar Gabriel Mazetto

Added notify key url to GeoNode

parent 8a7a332a
...@@ -60,6 +60,10 @@ class GeoNode < ActiveRecord::Base ...@@ -60,6 +60,10 @@ class GeoNode < ActiveRecord::Base
URI.join(uri, "#{uri.path}/", "api/#{API::API.version}/geo/refresh_wikis").to_s URI.join(uri, "#{uri.path}/", "api/#{API::API.version}/geo/refresh_wikis").to_s
end end
def notify_key_url
URI.join(uri, "#{uri.path}/", "api/#{API::API.version}/geo/refresh_key").to_s
end
def oauth_callback_url def oauth_callback_url
URI.join(uri, "#{uri.path}/", 'oauth/geo/callback').to_s URI.join(uri, "#{uri.path}/", 'oauth/geo/callback').to_s
end end
......
...@@ -163,6 +163,14 @@ describe GeoNode, type: :model do ...@@ -163,6 +163,14 @@ describe GeoNode, type: :model do
end end
end end
describe '#notify_key_url' do
let(:refresh_url) { 'https://localhost:3000/gitlab/api/v3/geo/refresh_key' }
it 'returns api url based on node uri' do
expect(new_node.notify_key_url).to eq(refresh_url)
end
end
describe '#oauth_callback_url' do describe '#oauth_callback_url' do
let(:oauth_callback_url) { 'https://localhost:3000/gitlab/oauth/geo/callback' } let(:oauth_callback_url) { 'https://localhost:3000/gitlab/oauth/geo/callback' }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment