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
00b45348
Commit
00b45348
authored
Apr 04, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix job setup in success empty state specs
parent
d883fe1c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
lib/gitlab/ci/status/build/success.rb
lib/gitlab/ci/status/build/success.rb
+1
-1
spec/lib/gitlab/ci/status/build/factory_spec.rb
spec/lib/gitlab/ci/status/build/factory_spec.rb
+2
-2
spec/lib/gitlab/ci/status/build/success_spec.rb
spec/lib/gitlab/ci/status/build/success_spec.rb
+6
-4
No files found.
lib/gitlab/ci/status/build/success.rb
View file @
00b45348
...
...
@@ -12,7 +12,7 @@ module Gitlab
end
def
self
.
matches?
(
build
,
user
)
build
.
success?
!
build
.
has_trace?
&&
build
.
success?
end
end
end
...
...
spec/lib/gitlab/ci/status/build/factory_spec.rb
View file @
00b45348
...
...
@@ -13,7 +13,7 @@ describe Gitlab::Ci::Status::Build::Factory do
end
context
'when build is successful'
do
let
(
:build
)
{
create
(
:ci_build
,
:success
)
}
let
(
:build
)
{
create
(
:ci_build
,
:success
,
:trace_artifact
)
}
it
'matches correct core status'
do
expect
(
factory
.
core_status
).
to
be_a
Gitlab
::
Ci
::
Status
::
Success
...
...
@@ -39,7 +39,7 @@ describe Gitlab::Ci::Status::Build::Factory do
context
'when job log gets erased'
do
before
do
build
.
trace
.
set
(
nil
)
build
.
erase
end
it
'matches correct extended statuses'
do
...
...
spec/lib/gitlab/ci/status/build/success_spec.rb
View file @
00b45348
...
...
@@ -12,18 +12,20 @@ describe Gitlab::Ci::Status::Build::Success do
end
describe
'.matches?'
do
subject
{
described_class
.
matches?
(
build
,
user
)
}
subject
{
described_class
.
matches?
(
build
,
user
)
}
context
'when build succeeded'
do
context
'when build succeeded
but does not have trace
'
do
let
(
:build
)
{
create
(
:ci_build
,
:success
)
}
it
'is a correct match'
do
build
.
erase
expect
(
subject
).
to
be
true
end
end
context
'when build
did not succeed
'
do
let
(
:build
)
{
create
(
:ci_build
,
:skipped
)
}
context
'when build
succeed but has trace
'
do
let
!
(
:build
)
{
create
(
:ci_build
,
:success
,
:trace_artifact
)
}
it
'does not match'
do
expect
(
subject
).
to
be
false
...
...
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