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
588ff19a
Commit
588ff19a
authored
Nov 12, 2018
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix unit tests
parent
4fad0ace
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
qa/qa/resource/api_fabricator.rb
qa/qa/resource/api_fabricator.rb
+20
-9
No files found.
qa/qa/resource/api_fabricator.rb
View file @
588ff19a
...
...
@@ -54,10 +54,8 @@ module QA
end
def
api_get_from
(
get_path
)
response
=
RestClient
::
Request
.
execute
(
method: :get
,
url:
Runtime
::
API
::
Request
.
new
(
api_client
,
get_path
).
url
,
verify_ssl:
false
)
url
=
Runtime
::
API
::
Request
.
new
(
api_client
,
get_path
).
url
response
=
get
(
url
)
unless
response
.
code
==
HTTP_STATUS_OK
raise
ResourceNotFoundError
,
"Resource at
#{
url
}
could not be found (
#{
response
.
code
}
): `
#{
response
}
`."
...
...
@@ -67,11 +65,9 @@ module QA
end
def
api_post
response
=
RestClient
::
Request
.
execute
(
method: :post
,
url:
Runtime
::
API
::
Request
.
new
(
api_client
,
api_post_path
).
url
,
payload:
api_post_body
,
verify_ssl:
false
)
response
=
post
(
Runtime
::
API
::
Request
.
new
(
api_client
,
api_post_path
).
url
,
api_post_body
)
unless
response
.
code
==
HTTP_STATUS_CREATED
raise
ResourceFabricationFailedError
,
"Fabrication of
#{
self
.
class
.
name
}
using the API failed (
#{
response
.
code
}
) with `
#{
response
}
`."
...
...
@@ -98,6 +94,21 @@ module QA
def
transform_api_resource
(
api_resource
)
api_resource
end
def
post
(
url
,
payload
)
RestClient
::
Request
.
execute
(
method: :post
,
url:
url
,
payload:
payload
,
verify_ssl:
false
)
end
def
get
(
url
)
RestClient
::
Request
.
execute
(
method: :get
,
url:
url
,
verify_ssl:
false
)
end
end
end
end
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