Commit 18232d7e authored by Matija Čupić's avatar Matija Čupić

Extract Variable into separate JSON Schema

parent 434a6158
...@@ -19,7 +19,7 @@ describe Groups::VariablesController do ...@@ -19,7 +19,7 @@ describe Groups::VariablesController do
it 'renders the ci_group_variable as json' do it 'renders the ci_group_variable as json' do
subject subject
expect(response).to match_response_schema('variable') expect(response).to match_response_schema('variables')
end end
end end
...@@ -85,7 +85,7 @@ describe Groups::VariablesController do ...@@ -85,7 +85,7 @@ describe Groups::VariablesController do
it 'has all variables in response' do it 'has all variables in response' do
subject subject
expect(response).to match_response_schema('variable') expect(response).to match_response_schema('variables')
end end
end end
...@@ -111,7 +111,7 @@ describe Groups::VariablesController do ...@@ -111,7 +111,7 @@ describe Groups::VariablesController do
it 'has all variables in response' do it 'has all variables in response' do
subject subject
expect(json_response['variables'].count).to eq(0) expect(response).to match_response_schema('variables')
end end
end end
end end
......
...@@ -24,7 +24,7 @@ describe Projects::VariablesController do ...@@ -24,7 +24,7 @@ describe Projects::VariablesController do
it 'renders the ci_variable as json' do it 'renders the ci_variable as json' do
subject subject
expect(response).to match_response_schema('variable') expect(response).to match_response_schema('variables')
end end
end end
...@@ -94,7 +94,7 @@ describe Projects::VariablesController do ...@@ -94,7 +94,7 @@ describe Projects::VariablesController do
it 'has all variables in response' do it 'has all variables in response' do
subject subject
expect(response).to match_response_schema('variable') expect(response).to match_response_schema('variables')
end end
end end
...@@ -120,7 +120,7 @@ describe Projects::VariablesController do ...@@ -120,7 +120,7 @@ describe Projects::VariablesController do
it 'has all variables in response' do it 'has all variables in response' do
subject subject
expect(json_response['variables'].count).to eq(0) expect(response).to match_response_schema('variables')
end end
end end
end end
......
{ {
"type": "object", "type": "object",
"required": ["variables"],
"properties": {
"variables": {
"type": "array",
"items": {
"required": [ "required": [
"id", "id",
"key", "key",
...@@ -16,9 +11,6 @@ ...@@ -16,9 +11,6 @@
"key": { "type": "string" }, "key": { "type": "string" },
"value": { "type": "string" }, "value": { "type": "string" },
"protected": { "type": "boolean" } "protected": { "type": "boolean" }
}
}
}
}, },
"additionalProperties": false "additionalProperties": false
} }
{
"type": "object",
"required": ["variables"],
"properties": {
"variables": {
"type": "array",
"items": { "$ref": "variable.json" }
}
},
"additionalProperties": false
}
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