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
f379e1b3
Commit
f379e1b3
authored
Apr 05, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename success to erased empty state spec
parent
00b45348
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
22 deletions
+31
-22
lib/gitlab/ci/status/build/erased.rb
lib/gitlab/ci/status/build/erased.rb
+2
-2
lib/gitlab/ci/status/build/factory.rb
lib/gitlab/ci/status/build/factory.rb
+1
-1
spec/lib/gitlab/ci/status/build/erased_spec.rb
spec/lib/gitlab/ci/status/build/erased_spec.rb
+5
-7
spec/lib/gitlab/ci/status/build/factory_spec.rb
spec/lib/gitlab/ci/status/build/factory_spec.rb
+23
-12
No files found.
lib/gitlab/ci/status/build/
success
.rb
→
lib/gitlab/ci/status/build/
erased
.rb
View file @
f379e1b3
...
...
@@ -2,7 +2,7 @@ module Gitlab
module
Ci
module
Status
module
Build
class
Success
<
Status
::
Extended
class
Erased
<
Status
::
Extended
def
illustration
{
image:
'illustrations/skipped-job_empty.svg'
,
...
...
@@ -12,7 +12,7 @@ module Gitlab
end
def
self
.
matches?
(
build
,
user
)
!
build
.
has_trace?
&&
build
.
success
?
build
.
erased
?
end
end
end
...
...
lib/gitlab/ci/status/build/factory.rb
View file @
f379e1b3
...
...
@@ -9,7 +9,7 @@ module Gitlab
Status
::
Build
::
Created
,
Status
::
Build
::
Pending
,
Status
::
Build
::
Skipped
,
Status
::
Build
::
Success
],
Status
::
Build
::
Erased
],
[
Status
::
Build
::
Cancelable
,
Status
::
Build
::
Retryable
],
[
Status
::
Build
::
FailedAllowed
,
...
...
spec/lib/gitlab/ci/status/build/
success
_spec.rb
→
spec/lib/gitlab/ci/status/build/
erased
_spec.rb
View file @
f379e1b3
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Build
::
Success
do
describe
Gitlab
::
Ci
::
Status
::
Build
::
Erased
do
let
(
:user
)
{
create
(
:user
)
}
subject
do
...
...
@@ -14,18 +14,16 @@ describe Gitlab::Ci::Status::Build::Success do
describe
'.matches?'
do
subject
{
described_class
.
matches?
(
build
,
user
)
}
context
'when build
succeeded but does not have trace
'
do
let
(
:build
)
{
create
(
:ci_build
,
:success
)
}
context
'when build
is erased
'
do
let
(
:build
)
{
create
(
:ci_build
,
:success
,
:erased
)
}
it
'is a correct match'
do
build
.
erase
expect
(
subject
).
to
be
true
end
end
context
'when build
succeed but has trace
'
do
let
!
(
:build
)
{
create
(
:ci_build
,
:success
,
:trace_artifact
)
}
context
'when build
is not erased
'
do
let
(
:build
)
{
create
(
:ci_build
,
:success
,
:trace_artifact
)
}
it
'does not match'
do
expect
(
subject
).
to
be
false
...
...
spec/lib/gitlab/ci/status/build/factory_spec.rb
View file @
f379e1b3
...
...
@@ -36,21 +36,32 @@ describe Gitlab::Ci::Status::Build::Factory do
expect
(
status
).
to
have_details
expect
(
status
).
to
have_action
end
end
context
'when job log gets erased'
do
before
do
build
.
erase
end
context
'when build is erased'
do
let
(
:build
)
{
create
(
:ci_build
,
:success
,
:erased
)
}
it
'matches correct extended statuses'
do
expect
(
factory
.
extended_statuses
)
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Build
::
Success
,
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
]
end
it
'matches correct core status'
do
expect
(
factory
.
core_status
).
to
be_a
Gitlab
::
Ci
::
Status
::
Success
end
it
'fabricates a retryable build status'
do
expect
(
status
).
to
be_a
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
end
it
'matches correct extended statuses'
do
expect
(
factory
.
extended_statuses
)
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Build
::
Erased
,
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
]
end
it
'fabricates a retryable build status'
do
expect
(
status
).
to
be_a
Gitlab
::
Ci
::
Status
::
Build
::
Retryable
end
it
'fabricates status with correct details'
do
expect
(
status
.
text
).
to
eq
'passed'
expect
(
status
.
icon
).
to
eq
'status_success'
expect
(
status
.
favicon
).
to
eq
'favicon_status_success'
expect
(
status
.
label
).
to
eq
'passed'
expect
(
status
).
to
have_details
expect
(
status
).
to
have_action
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