BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
18232d7e
Unverified
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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
24 deletions
+27
-24
variables_controller_spec.rb
spec/controllers/groups/variables_controller_spec.rb
+3
-3
variables_controller_spec.rb
spec/controllers/projects/variables_controller_spec.rb
+3
-3
variable.json
spec/fixtures/api/schemas/variable.json
+10
-18
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
it
'renders the ci_group_variable as json'
do
subject
expect
(
response
).
to
match_response_schema
(
'variable'
)
expect
(
response
).
to
match_response_schema
(
'variable
s
'
)
end
end
...
...
@@ -85,7 +85,7 @@ describe Groups::VariablesController do
it
'has all variables in response'
do
subject
expect
(
response
).
to
match_response_schema
(
'variable'
)
expect
(
response
).
to
match_response_schema
(
'variable
s
'
)
end
end
...
...
@@ -111,7 +111,7 @@ describe Groups::VariablesController do
it
'has all variables in response'
do
subject
expect
(
json_response
[
'variables'
].
count
).
to
eq
(
0
)
expect
(
response
).
to
match_response_schema
(
'variables'
)
end
end
end
...
...
spec/controllers/projects/variables_controller_spec.rb
View file @
18232d7e
...
...
@@ -24,7 +24,7 @@ describe Projects::VariablesController do
it
'renders the ci_variable as json'
do
subject
expect
(
response
).
to
match_response_schema
(
'variable'
)
expect
(
response
).
to
match_response_schema
(
'variable
s
'
)
end
end
...
...
@@ -94,7 +94,7 @@ describe Projects::VariablesController do
it
'has all variables in response'
do
subject
expect
(
response
).
to
match_response_schema
(
'variable'
)
expect
(
response
).
to
match_response_schema
(
'variable
s
'
)
end
end
...
...
@@ -120,7 +120,7 @@ describe Projects::VariablesController do
it
'has all variables in response'
do
subject
expect
(
json_response
[
'variables'
].
count
).
to
eq
(
0
)
expect
(
response
).
to
match_response_schema
(
'variables'
)
end
end
end
...
...
spec/fixtures/api/schemas/variable.json
View file @
18232d7e
{
"type"
:
"object"
,
"required"
:
[
"variables"
],
"required"
:
[
"id"
,
"key"
,
"value"
,
"protected"
],
"properties"
:
{
"variables"
:
{
"type"
:
"array"
,
"items"
:
{
"required"
:
[
"id"
,
"key"
,
"value"
,
"protected"
],
"properties"
:
{
"id"
:
{
"type"
:
"integer"
},
"key"
:
{
"type"
:
"string"
},
"value"
:
{
"type"
:
"string"
},
"protected"
:
{
"type"
:
"boolean"
}
}
}
}
"id"
:
{
"type"
:
"integer"
},
"key"
:
{
"type"
:
"string"
},
"value"
:
{
"type"
:
"string"
},
"protected"
:
{
"type"
:
"boolean"
}
},
"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