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
5390c2e8
Commit
5390c2e8
authored
May 07, 2020
by
James Fargher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validate API against schema
parent
b7d38443
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
spec/fixtures/api/schemas/public_api/v4/project_repository_storage_move.json
...chemas/public_api/v4/project_repository_storage_move.json
+20
-0
spec/fixtures/api/schemas/public_api/v4/project_repository_storage_moves.json
...hemas/public_api/v4/project_repository_storage_moves.json
+6
-0
spec/requests/api/project_repository_storage_moves_spec.rb
spec/requests/api/project_repository_storage_moves_spec.rb
+2
-2
No files found.
spec/fixtures/api/schemas/public_api/v4/project_repository_storage_move.json
0 → 100644
View file @
5390c2e8
{
"type"
:
"object"
,
"required"
:
[
"id"
,
"created_at"
,
"state"
,
"source_storage_name"
,
"destination_storage_name"
,
"project"
],
"properties"
:
{
"id"
:
{
"type"
:
"integer"
},
"created_at"
:
{
"type"
:
"date"
},
"state"
:
{
"type"
:
"string"
},
"source_storage_name"
:
{
"type"
:
"string"
},
"destination_storage_name"
:
{
"type"
:
"string"
},
"project"
:
{
"type"
:
"object"
}
},
"additionalProperties"
:
false
}
spec/fixtures/api/schemas/public_api/v4/project_repository_storage_moves.json
0 → 100644
View file @
5390c2e8
{
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"./project_repository_storage_move.json"
}
}
spec/requests/api/project_repository_storage_moves_spec.rb
View file @
5390c2e8
...
@@ -16,7 +16,7 @@ describe API::ProjectRepositoryStorageMoves do
...
@@ -16,7 +16,7 @@ describe API::ProjectRepositoryStorageMoves do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
include_pagination_headers
expect
(
response
).
to
include_pagination_headers
expect
(
json_response
).
to
be_an
Array
expect
(
response
).
to
match_response_schema
(
'public_api/v4/project_repository_storage_moves'
)
expect
(
json_response
.
size
).
to
eq
(
1
)
expect
(
json_response
.
size
).
to
eq
(
1
)
expect
(
json_response
.
first
[
'id'
]).
to
eq
(
storage_move
.
id
)
expect
(
json_response
.
first
[
'id'
]).
to
eq
(
storage_move
.
id
)
expect
(
json_response
.
first
[
'state'
]).
to
eq
(
storage_move
.
human_state_name
)
expect
(
json_response
.
first
[
'state'
]).
to
eq
(
storage_move
.
human_state_name
)
...
@@ -36,7 +36,7 @@ describe API::ProjectRepositoryStorageMoves do
...
@@ -36,7 +36,7 @@ describe API::ProjectRepositoryStorageMoves do
get
api
(
"/project_repository_storage_moves/
#{
storage_move
.
id
}
"
,
user
)
get
api
(
"/project_repository_storage_moves/
#{
storage_move
.
id
}
"
,
user
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
).
to
be_a
Hash
expect
(
response
).
to
match_response_schema
(
'public_api/v4/project_repository_storage_move'
)
expect
(
json_response
[
'id'
]).
to
eq
(
storage_move
.
id
)
expect
(
json_response
[
'id'
]).
to
eq
(
storage_move
.
id
)
expect
(
json_response
[
'state'
]).
to
eq
(
storage_move
.
human_state_name
)
expect
(
json_response
[
'state'
]).
to
eq
(
storage_move
.
human_state_name
)
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