Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
0
Merge Requests
0
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-shell
Commits
dd4bd1d7
Commit
dd4bd1d7
authored
Jul 19, 2018
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add #base_api_endpoint for re-usability
parent
3042a721
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
lib/http_helper.rb
lib/http_helper.rb
+5
-1
spec/gitlab_net_spec.rb
spec/gitlab_net_spec.rb
+8
-0
No files found.
lib/http_helper.rb
View file @
dd4bd1d7
...
@@ -7,8 +7,12 @@ module HTTPHelper
...
@@ -7,8 +7,12 @@ module HTTPHelper
@config
||=
GitlabConfig
.
new
@config
||=
GitlabConfig
.
new
end
end
def
base_api_endpoint
"
#{
config
.
gitlab_url
}
/api/v4"
end
def
host
def
host
"
#{
config
.
gitlab_url
}
/api/v4
/internal"
"
#{
base_api_endpoint
}
/internal"
end
end
def
http_client_for
(
uri
,
options
=
{})
def
http_client_for
(
uri
,
options
=
{})
...
...
spec/gitlab_net_spec.rb
View file @
dd4bd1d7
...
@@ -353,6 +353,14 @@ describe GitlabNet, vcr: true do
...
@@ -353,6 +353,14 @@ describe GitlabNet, vcr: true do
end
end
end
end
describe
:base_api_endpoint
do
let
(
:net
)
{
GitlabNet
.
new
}
subject
{
net
.
send
:base_api_endpoint
}
it
{
should
include
(
net
.
send
(
:config
).
gitlab_url
)
}
it
(
"uses API version 4"
)
{
should
end_with
(
"api/v4"
)
}
end
describe
:host
do
describe
:host
do
let
(
:net
)
{
GitlabNet
.
new
}
let
(
:net
)
{
GitlabNet
.
new
}
subject
{
net
.
send
:host
}
subject
{
net
.
send
:host
}
...
...
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