Use API url helper method to build the node status URL

parent 23518c6e
......@@ -74,7 +74,7 @@ class GeoNode < ActiveRecord::Base
end
def status_url
URI.join(uri, "#{uri.path}/", "api/#{API::API.version}/geo/status").to_s
geo_api_url('status')
end
def oauth_callback_url
......
......@@ -190,6 +190,14 @@ describe GeoNode, type: :model do
end
end
describe '#geo_status_url' do
let(:status_url) { "https://localhost:3000/gitlab/api/#{api_version}/geo/status" }
it 'returns api url based on node uri' do
expect(new_node.status_url).to eq(status_url)
end
end
describe '#oauth_callback_url' do
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