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
Léo-Paul Géneau
gitlab-ce
Commits
df6040bb
Commit
df6040bb
authored
May 17, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zj keen eye2
parent
c7fc65e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
8 deletions
+2
-8
lib/api/pipeline_schedules.rb
lib/api/pipeline_schedules.rb
+1
-2
spec/requests/api/pipeline_schedules_spec.rb
spec/requests/api/pipeline_schedules_spec.rb
+1
-6
No files found.
lib/api/pipeline_schedules.rb
View file @
df6040bb
...
@@ -54,7 +54,7 @@ module API
...
@@ -54,7 +54,7 @@ module API
.
new
(
user_project
,
current_user
,
declared_params
(
include_missing:
false
))
.
new
(
user_project
,
current_user
,
declared_params
(
include_missing:
false
))
.
execute
.
execute
if
pipeline_schedule
.
vali
d?
if
pipeline_schedule
.
persiste
d?
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
else
else
render_validation_error!
(
pipeline_schedule
)
render_validation_error!
(
pipeline_schedule
)
...
@@ -98,7 +98,6 @@ module API
...
@@ -98,7 +98,6 @@ module API
return
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
return
not_found!
(
'PipelineSchedule'
)
unless
pipeline_schedule
if
pipeline_schedule
.
own!
(
current_user
)
if
pipeline_schedule
.
own!
(
current_user
)
status
:ok
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
present
pipeline_schedule
,
with:
Entities
::
PipelineSchedule
else
else
render_validation_error!
(
pipeline_schedule
)
render_validation_error!
(
pipeline_schedule
)
...
...
spec/requests/api/pipeline_schedules_spec.rb
View file @
df6040bb
...
@@ -160,15 +160,10 @@ describe API::PipelineSchedules do
...
@@ -160,15 +160,10 @@ describe API::PipelineSchedules do
it
'updates cron'
do
it
'updates cron'
do
put
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules/
#{
pipeline_schedule
.
id
}
"
,
developer
),
put
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules/
#{
pipeline_schedule
.
id
}
"
,
developer
),
cron:
'1 2 3 4 *'
cron:
'1 2 3 4 *'
pipeline_schedule
.
reload
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
response
).
to
have_http_status
(
:ok
)
expect
(
response
).
to
match_response_schema
(
'pipeline_schedule'
)
expect
(
response
).
to
match_response_schema
(
'pipeline_schedule'
)
expect
(
json_response
[
'cron'
]).
to
eq
(
'1 2 3 4 *'
)
expect
(
json_response
[
'cron'
]).
to
eq
(
'1 2 3 4 *'
)
expect
(
pipeline_schedule
.
next_run_at
.
min
).
to
eq
(
1
)
expect
(
pipeline_schedule
.
next_run_at
.
hour
).
to
eq
(
2
)
expect
(
pipeline_schedule
.
next_run_at
.
day
).
to
eq
(
3
)
expect
(
pipeline_schedule
.
next_run_at
.
month
).
to
eq
(
4
)
end
end
context
'when cron has validation error'
do
context
'when cron has validation error'
do
...
@@ -208,7 +203,7 @@ describe API::PipelineSchedules do
...
@@ -208,7 +203,7 @@ describe API::PipelineSchedules do
it
'updates owner'
do
it
'updates owner'
do
post
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules/
#{
pipeline_schedule
.
id
}
/take_ownership"
,
developer
)
post
api
(
"/projects/
#{
project
.
id
}
/pipeline_schedules/
#{
pipeline_schedule
.
id
}
/take_ownership"
,
developer
)
expect
(
response
).
to
have_http_status
(
:
ok
)
expect
(
response
).
to
have_http_status
(
:
created
)
expect
(
response
).
to
match_response_schema
(
'pipeline_schedule'
)
expect
(
response
).
to
match_response_schema
(
'pipeline_schedule'
)
end
end
end
end
...
...
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