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
3b7f3428
Commit
3b7f3428
authored
Jan 13, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify :ci_variable factory
parent
d3380876
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
variables.rb
spec/factories/ci/variables.rb
+2
-5
variables_spec.rb
spec/requests/api/variables_spec.rb
+2
-2
No files found.
spec/factories/ci/variables.rb
View file @
3b7f3428
...
@@ -16,10 +16,7 @@
...
@@ -16,10 +16,7 @@
FactoryGirl
.
define
do
FactoryGirl
.
define
do
factory
:ci_variable
,
class:
Ci
::
Variable
do
factory
:ci_variable
,
class:
Ci
::
Variable
do
id
10
sequence
(
:key
)
{
|
n
|
"VARIABLE_
#{
n
}
"
}
key
'TEST_VARIABLE_1'
value
'VARIABLE_VALUE'
value
'VALUE_1'
project
factory: :empty_project
end
end
end
end
spec/requests/api/variables_spec.rb
View file @
3b7f3428
...
@@ -46,7 +46,7 @@ describe API::API, api: true do
...
@@ -46,7 +46,7 @@ describe API::API, api: true do
expect
(
json_response
[
'value'
]).
to
eq
(
variable
.
value
)
expect
(
json_response
[
'value'
]).
to
eq
(
variable
.
value
)
end
end
it
'should respond
e
with 404 Not Found if requesting non-existing variable'
do
it
'should respond with 404 Not Found if requesting non-existing variable'
do
get
api
(
"/projects/
#{
project
.
id
}
/variables/non_existing_variable"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/variables/non_existing_variable"
,
user
)
expect
(
response
.
status
).
to
eq
(
404
)
expect
(
response
.
status
).
to
eq
(
404
)
...
@@ -84,7 +84,7 @@ describe API::API, api: true do
...
@@ -84,7 +84,7 @@ describe API::API, api: true do
it
'should not allow to duplicate variable key'
do
it
'should not allow to duplicate variable key'
do
expect
do
expect
do
post
api
(
"/projects/
#{
project
.
id
}
/variables"
,
user
),
key:
'TEST_VARIABLE_1'
,
value:
'VALUE_2'
post
api
(
"/projects/
#{
project
.
id
}
/variables"
,
user
),
key:
variable
.
key
,
value:
'VALUE_2'
end
.
to
change
{
project
.
variables
.
count
}.
by
(
0
)
end
.
to
change
{
project
.
variables
.
count
}.
by
(
0
)
expect
(
response
.
status
).
to
eq
(
400
)
expect
(
response
.
status
).
to
eq
(
400
)
...
...
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