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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
18232d7e
Commit
18232d7e
authored
Feb 01, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract Variable into separate JSON Schema
parent
434a6158
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
24 deletions
+27
-24
spec/controllers/groups/variables_controller_spec.rb
spec/controllers/groups/variables_controller_spec.rb
+3
-3
spec/controllers/projects/variables_controller_spec.rb
spec/controllers/projects/variables_controller_spec.rb
+3
-3
spec/fixtures/api/schemas/variable.json
spec/fixtures/api/schemas/variable.json
+10
-18
spec/fixtures/api/schemas/variables.json
spec/fixtures/api/schemas/variables.json
+11
-0
No files found.
spec/controllers/groups/variables_controller_spec.rb
View file @
18232d7e
...
@@ -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
(
'variable
s
'
)
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
(
'variable
s
'
)
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
...
...
spec/controllers/projects/variables_controller_spec.rb
View file @
18232d7e
...
@@ -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
(
'variable
s
'
)
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
(
'variable
s
'
)
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
...
...
spec/fixtures/api/schemas/variable.json
View file @
18232d7e
{
{
"type"
:
"object"
,
"type"
:
"object"
,
"required"
:
[
"variables"
],
"required"
:
[
"id"
,
"key"
,
"value"
,
"protected"
],
"properties"
:
{
"properties"
:
{
"variables"
:
{
"id"
:
{
"type"
:
"integer"
},
"type"
:
"array"
,
"key"
:
{
"type"
:
"string"
},
"items"
:
{
"value"
:
{
"type"
:
"string"
},
"required"
:
[
"protected"
:
{
"type"
:
"boolean"
}
"id"
,
"key"
,
"value"
,
"protected"
],
"properties"
:
{
"id"
:
{
"type"
:
"integer"
},
"key"
:
{
"type"
:
"string"
},
"value"
:
{
"type"
:
"string"
},
"protected"
:
{
"type"
:
"boolean"
}
}
}
}
},
},
"additionalProperties"
:
false
"additionalProperties"
:
false
}
}
spec/fixtures/api/schemas/variables.json
0 → 100644
View file @
18232d7e
{
"type"
:
"object"
,
"required"
:
[
"variables"
],
"properties"
:
{
"variables"
:
{
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"variable.json"
}
}
},
"additionalProperties"
:
false
}
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