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
5905d89b
Commit
5905d89b
authored
Oct 03, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for build presenter
parent
41fe9edc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
spec/presenters/ci/build_presenter_spec.rb
spec/presenters/ci/build_presenter_spec.rb
+36
-0
No files found.
spec/presenters/ci/build_presenter_spec.rb
View file @
5905d89b
...
@@ -218,6 +218,42 @@ describe Ci::BuildPresenter do
...
@@ -218,6 +218,42 @@ describe Ci::BuildPresenter do
end
end
end
end
describe
'#execute_in'
do
subject
{
presenter
.
execute_in
}
context
'when build is scheduled'
do
context
'when schedule is not expired'
do
let
(
:build
)
{
create
(
:ci_build
,
:scheduled
)
}
it
'returns execution time'
do
Timecop
.
freeze
do
is_expected
.
to
eq
(
60.0
)
end
end
end
context
'when schedule is expired'
do
let
(
:build
)
{
create
(
:ci_build
,
:expired_scheduled
)
}
it
'returns execution time'
do
Timecop
.
freeze
do
is_expected
.
to
eq
(
0
)
end
end
end
end
context
'when build is not delayed'
do
let
(
:build
)
{
create
(
:ci_build
)
}
it
'does not return execution time'
do
Timecop
.
freeze
do
is_expected
.
to
be_falsy
end
end
end
end
describe
'#callout_failure_message'
do
describe
'#callout_failure_message'
do
let
(
:build
)
{
create
(
:ci_build
,
:failed
,
:api_failure
)
}
let
(
:build
)
{
create
(
:ci_build
,
:failed
,
:api_failure
)
}
...
...
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