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
a93a088f
Commit
a93a088f
authored
Oct 04, 2021
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix undefined method error in validate_remote_git_endpoint service
* update tests Changelog: fixed
parent
8f1f5ab8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
app/services/import/validate_remote_git_endpoint_service.rb
app/services/import/validate_remote_git_endpoint_service.rb
+1
-1
spec/services/import/validate_remote_git_endpoint_service_spec.rb
...vices/import/validate_remote_git_endpoint_service_spec.rb
+8
-0
No files found.
app/services/import/validate_remote_git_endpoint_service.rb
View file @
a93a088f
...
...
@@ -21,7 +21,7 @@ module Import
def
execute
uri
=
Gitlab
::
Utils
.
parse_url
(
@params
[
:url
])
return
error
(
"In
valid URL"
)
unless
uri
return
ServiceResponse
.
error
(
message:
"
#{
@params
[
:url
]
}
is not a
valid URL"
)
unless
uri
uri
.
fragment
=
nil
url
=
Gitlab
::
Utils
.
append_path
(
uri
.
to_s
,
"/info/refs?service=
#{
GIT_SERVICE_NAME
}
"
)
...
...
spec/services/import/validate_remote_git_endpoint_service_spec.rb
View file @
a93a088f
...
...
@@ -46,6 +46,14 @@ RSpec.describe Import::ValidateRemoteGitEndpointService do
expect
(
result
.
message
).
to
eq
(
error_message
)
end
it
'reports error when invalid URL is provided'
do
result
=
described_class
.
new
(
url:
1
).
execute
expect
(
result
).
to
be_a
(
ServiceResponse
)
expect
(
result
.
error?
).
to
be
(
true
)
expect
(
result
.
message
).
to
eq
(
'1 is not a valid URL'
)
end
it
'reports error when required header is missing'
do
stub_full_request
(
endpoint_url
,
method: :get
).
to_return
(
valid_response
.
merge
({
headers:
nil
}))
...
...
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