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
62480461
Commit
62480461
authored
Apr 01, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed failed tests
parent
d9574c0c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
spec/models/ci/trigger_schedule_spec.rb
spec/models/ci/trigger_schedule_spec.rb
+10
-12
No files found.
spec/models/ci/trigger_schedule_spec.rb
View file @
62480461
...
@@ -21,7 +21,7 @@ describe Ci::TriggerSchedule, models: true do
...
@@ -21,7 +21,7 @@ describe Ci::TriggerSchedule, models: true do
trigger_schedule
.
valid?
trigger_schedule
.
valid?
end
end
context
'when
every hour
'
do
context
'when
cron frequency is too short
'
do
let
(
:cron
)
{
'0 * * * *'
}
# 00:00, 01:00, 02:00, ..., 23:00
let
(
:cron
)
{
'0 * * * *'
}
# 00:00, 01:00, 02:00, ..., 23:00
it
'gets an error'
do
it
'gets an error'
do
...
@@ -29,8 +29,8 @@ describe Ci::TriggerSchedule, models: true do
...
@@ -29,8 +29,8 @@ describe Ci::TriggerSchedule, models: true do
end
end
end
end
context
'when
each six hours
'
do
context
'when
cron frequency is eligible
'
do
let
(
:cron
)
{
'0
*/6 * * *'
}
# 00:00, 06:00, 12:00, 18:00
let
(
:cron
)
{
'0
0 1 1 *'
}
# every 00:00, January 1st
it
'gets no errors'
do
it
'gets no errors'
do
expect
(
trigger_schedule
.
errors
[
:cron
]).
to
be_empty
expect
(
trigger_schedule
.
errors
[
:cron
]).
to
be_empty
...
@@ -39,7 +39,6 @@ describe Ci::TriggerSchedule, models: true do
...
@@ -39,7 +39,6 @@ describe Ci::TriggerSchedule, models: true do
end
end
describe
'#schedule_next_run!'
do
describe
'#schedule_next_run!'
do
context
'when more_than_1_hour_from_now'
do
let
(
:trigger_schedule
)
{
create
(
:ci_trigger_schedule
,
:cron_nightly_build
)
}
let
(
:trigger_schedule
)
{
create
(
:ci_trigger_schedule
,
:cron_nightly_build
)
}
before
do
before
do
...
@@ -51,5 +50,4 @@ describe Ci::TriggerSchedule, models: true do
...
@@ -51,5 +50,4 @@ describe Ci::TriggerSchedule, models: true do
expect
(
Ci
::
TriggerSchedule
.
last
.
next_run_at
).
to
eq
(
next_time
)
expect
(
Ci
::
TriggerSchedule
.
last
.
next_run_at
).
to
eq
(
next_time
)
end
end
end
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