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
fb8f32a9
Commit
fb8f32a9
authored
Aug 22, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish spec
parent
03f72f0f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
17 deletions
+7
-17
pipeline_schedules.rb
lib/api/pipeline_schedules.rb
+1
-1
pipeline_schedules_spec.rb
spec/requests/api/pipeline_schedules_spec.rb
+6
-16
No files found.
lib/api/pipeline_schedules.rb
View file @
fb8f32a9
...
@@ -184,7 +184,7 @@ module API
...
@@ -184,7 +184,7 @@ module API
not_found!
(
'Variable'
)
unless
variable
not_found!
(
'Variable'
)
unless
variable
status
:accepted
status
:accepted
present
variable
,
with:
Entities
::
Variable
present
variable
.
destroy
,
with:
Entities
::
Variable
end
end
end
end
...
...
spec/requests/api/pipeline_schedules_spec.rb
View file @
fb8f32a9
...
@@ -330,7 +330,7 @@ describe API::PipelineSchedules do
...
@@ -330,7 +330,7 @@ describe API::PipelineSchedules do
end
end
end
end
context
'when
cron
has validation error'
do
context
'when
key
has validation error'
do
it
'does not create pipeline_schedule_variable'
do
it
'does not create pipeline_schedule_variable'
do
post
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules/
#{
pipeline_schedule
.
id
}
/variables"
,
developer
),
post
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules/
#{
pipeline_schedule
.
id
}
/variables"
,
developer
),
params
.
merge
(
'key'
=>
'!?!?'
)
params
.
merge
(
'key'
=>
'!?!?'
)
...
@@ -368,23 +368,13 @@ describe API::PipelineSchedules do
...
@@ -368,23 +368,13 @@ describe API::PipelineSchedules do
end
end
context
'authenticated user with valid permissions'
do
context
'authenticated user with valid permissions'
do
it
'updates
cron
'
do
it
'updates
pipeline_schedule_variable
'
do
put
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules/
#{
pipeline_schedule
.
id
}
/variables/
#{
pipeline_schedule_variable
.
key
}
"
,
developer
),
put
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules/
#{
pipeline_schedule
.
id
}
/variables/
#{
pipeline_schedule_variable
.
key
}
"
,
developer
),
key:
pipeline_schedule_variable
.
key
,
value:
'updated_value'
value:
'updated_value'
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
response
).
to
match_response_schema
(
'pipeline_schedule_variable'
)
expect
(
response
).
to
match_response_schema
(
'pipeline_schedule_variable'
)
expect
(
json_response
[
'key'
]).
to
eq
(
'updated_value'
)
expect
(
json_response
[
'value'
]).
to
eq
(
'updated_value'
)
end
context
'when cron has validation error'
do
it
'does not update pipeline_schedule_variable'
do
put
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules/
#{
pipeline_schedule
.
id
}
/variables/
#{
pipeline_schedule_variable
.
key
}
"
,
developer
),
key:
'!?!?'
expect
(
response
).
to
have_http_status
(
:bad_request
)
expect
(
json_response
[
'message'
]).
to
have_key
(
'key'
)
end
end
end
end
end
...
@@ -412,7 +402,7 @@ describe API::PipelineSchedules do
...
@@ -412,7 +402,7 @@ describe API::PipelineSchedules do
create
(
:ci_pipeline_schedule
,
project:
project
,
owner:
developer
)
create
(
:ci_pipeline_schedule
,
project:
project
,
owner:
developer
)
end
end
let
(
:pipeline_schedule_variable
)
do
let
!
(
:pipeline_schedule_variable
)
do
create
(
:ci_pipeline_schedule_variable
,
pipeline_schedule:
pipeline_schedule
)
create
(
:ci_pipeline_schedule_variable
,
pipeline_schedule:
pipeline_schedule
)
end
end
...
@@ -424,7 +414,7 @@ describe API::PipelineSchedules do
...
@@ -424,7 +414,7 @@ describe API::PipelineSchedules do
it
'deletes pipeline_schedule_variable'
do
it
'deletes pipeline_schedule_variable'
do
expect
do
expect
do
delete
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules/
#{
pipeline_schedule
.
id
}
/variables/
#{
pipeline_schedule_variable
.
key
}
"
,
master
)
delete
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules/
#{
pipeline_schedule
.
id
}
/variables/
#{
pipeline_schedule_variable
.
key
}
"
,
master
)
end
.
to
change
{
project
.
pipeline_schedules
.
count
}.
by
(
-
1
)
end
.
to
change
{
Ci
::
PipelineScheduleVariable
.
count
}.
by
(
-
1
)
expect
(
response
).
to
have_http_status
(
:accepted
)
expect
(
response
).
to
have_http_status
(
:accepted
)
expect
(
response
).
to
match_response_schema
(
'pipeline_schedule_variable'
)
expect
(
response
).
to
match_response_schema
(
'pipeline_schedule_variable'
)
...
...
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