Commit ffc7df0c authored by Felipe Artur's avatar Felipe Artur

Fix related epic links and issue links specs fixtures

Related epic links and issue links fixtures
were not testing api response correctly because their
format was not correct.

Changelog: other
parent 9ef0cf74
...@@ -69,5 +69,5 @@ ...@@ -69,5 +69,5 @@
"required": [ "required": [
"id", "iid", "group_id", "title", "confidential", "_links" "id", "iid", "group_id", "title", "confidential", "_links"
], ],
"additionalProperties": false "additionalProperties": true
} }
{
"type": "array",
"items": {
"type": "object",
"properties" : {
"$ref": "./related_epic_link.json"
}
}
}
{
"type": "array",
"items": {
"type": "object",
"allOf": [
{ "$ref": "epic.json" },
{
"required" : [
"link_type",
"related_epic_link_id",
"link_created_at",
"link_updated_at"
],
"properties" : {
"link_type": {
"type": "string",
"enum": ["relates_to", "blocks", "is_blocked_by"]
},
"related_epic_link_id": { "type": "integer" },
"link_created_at": { "type": "string" },
"link_updated_at": { "type": "string" }
}
}
]
}
}
...@@ -72,7 +72,7 @@ RSpec.describe API::RelatedEpicLinks do ...@@ -72,7 +72,7 @@ RSpec.describe API::RelatedEpicLinks do
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(json_response.length).to eq(2) expect(json_response.length).to eq(2)
expect(response).to match_response_schema('public_api/v4/related_epic_links', dir: 'ee') expect(response).to match_response_schema('public_api/v4/related_epics', dir: 'ee')
end end
it 'returns multiple links without N + 1' do it 'returns multiple links without N + 1' do
......
{
"type": "array",
"items": {
"type": "object",
"properties" : {
"$ref": "./issue_link.json"
}
}
}
{
"type": "array",
"items": {
"type": "object",
"allOf": [
{ "$ref": "../../../../../../spec/fixtures/api/schemas/public_api/v4/issue.json" },
{
"required" : [
"link_type",
"issue_link_id",
"link_created_at",
"link_updated_at"
],
"properties" : {
"link_type": {
"type": "string",
"enum": ["relates_to", "blocks", "is_blocked_by"]
},
"issue_link_id": { "type": "integer" },
"link_created_at": { "type": "string" },
"link_updated_at": { "type": "string" }
}
}
]
}
}
...@@ -34,7 +34,7 @@ RSpec.describe API::IssueLinks do ...@@ -34,7 +34,7 @@ RSpec.describe API::IssueLinks do
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(json_response.length).to eq(2) expect(json_response.length).to eq(2)
expect(response).to match_response_schema('public_api/v4/issue_links') expect(response).to match_response_schema('public_api/v4/related_issues')
end end
it 'returns multiple links without N + 1' do it 'returns multiple links without N + 1' do
......
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