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
Tatuya Kamada
gitlab-ce
Commits
bb2460c1
Commit
bb2460c1
authored
Mar 06, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve specs for detailed statuses with manual actions
parent
cb4c9a03
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
42 additions
and
57 deletions
+42
-57
lib/gitlab/ci/status/build/play.rb
lib/gitlab/ci/status/build/play.rb
+0
-12
lib/gitlab/ci/status/build/stop.rb
lib/gitlab/ci/status/build/stop.rb
+0
-12
spec/lib/gitlab/ci/status/build/factory_spec.rb
spec/lib/gitlab/ci/status/build/factory_spec.rb
+4
-2
spec/lib/gitlab/ci/status/build/play_spec.rb
spec/lib/gitlab/ci/status/build/play_spec.rb
+0
-12
spec/lib/gitlab/ci/status/build/stop_spec.rb
spec/lib/gitlab/ci/status/build/stop_spec.rb
+0
-12
spec/lib/gitlab/ci/status/canceled_spec.rb
spec/lib/gitlab/ci/status/canceled_spec.rb
+1
-1
spec/lib/gitlab/ci/status/created_spec.rb
spec/lib/gitlab/ci/status/created_spec.rb
+1
-1
spec/lib/gitlab/ci/status/failed_spec.rb
spec/lib/gitlab/ci/status/failed_spec.rb
+1
-1
spec/lib/gitlab/ci/status/manual_spec.rb
spec/lib/gitlab/ci/status/manual_spec.rb
+23
-0
spec/lib/gitlab/ci/status/pending_spec.rb
spec/lib/gitlab/ci/status/pending_spec.rb
+1
-1
spec/lib/gitlab/ci/status/running_spec.rb
spec/lib/gitlab/ci/status/running_spec.rb
+1
-1
spec/lib/gitlab/ci/status/skipped_spec.rb
spec/lib/gitlab/ci/status/skipped_spec.rb
+1
-1
spec/lib/gitlab/ci/status/success_spec.rb
spec/lib/gitlab/ci/status/success_spec.rb
+1
-1
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+8
-0
No files found.
lib/gitlab/ci/status/build/play.rb
View file @
bb2460c1
...
...
@@ -5,22 +5,10 @@ module Gitlab
class
Play
<
SimpleDelegator
include
Status
::
Extended
def
text
'manual'
end
def
label
'manual play action'
end
def
icon
'icon_status_manual'
end
def
group
'manual'
end
def
has_action?
can?
(
user
,
:update_build
,
subject
)
end
...
...
lib/gitlab/ci/status/build/stop.rb
View file @
bb2460c1
...
...
@@ -5,22 +5,10 @@ module Gitlab
class
Stop
<
SimpleDelegator
include
Status
::
Extended
def
text
'manual'
end
def
label
'manual stop action'
end
def
icon
'icon_status_manual'
end
def
group
'manual'
end
def
has_action?
can?
(
user
,
:update_build
,
subject
)
end
...
...
spec/lib/gitlab/ci/status/build/factory_spec.rb
View file @
bb2460c1
...
...
@@ -200,12 +200,13 @@ describe Gitlab::Ci::Status::Build::Factory do
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Build
::
Play
]
end
it
'fabricates a
core skipp
ed status'
do
it
'fabricates a
play detail
ed status'
do
expect
(
status
).
to
be_a
Gitlab
::
Ci
::
Status
::
Build
::
Play
end
it
'fabricates status with correct details'
do
expect
(
status
.
text
).
to
eq
'manual'
expect
(
status
.
group
).
to
eq
'manual'
expect
(
status
.
icon
).
to
eq
'icon_status_manual'
expect
(
status
.
label
).
to
eq
'manual play action'
expect
(
status
).
to
have_details
...
...
@@ -226,12 +227,13 @@ describe Gitlab::Ci::Status::Build::Factory do
.
to
eq
[
Gitlab
::
Ci
::
Status
::
Build
::
Stop
]
end
it
'fabricates a
core skipp
ed status'
do
it
'fabricates a
stop detail
ed status'
do
expect
(
status
).
to
be_a
Gitlab
::
Ci
::
Status
::
Build
::
Stop
end
it
'fabricates status with correct details'
do
expect
(
status
.
text
).
to
eq
'manual'
expect
(
status
.
group
).
to
eq
'manual'
expect
(
status
.
icon
).
to
eq
'icon_status_manual'
expect
(
status
.
label
).
to
eq
'manual stop action'
expect
(
status
).
to
have_details
...
...
spec/lib/gitlab/ci/status/build/play_spec.rb
View file @
bb2460c1
...
...
@@ -6,22 +6,10 @@ describe Gitlab::Ci::Status::Build::Play do
subject
{
described_class
.
new
(
status
)
}
describe
'#text'
do
it
{
expect
(
subject
.
text
).
to
eq
'manual'
}
end
describe
'#label'
do
it
{
expect
(
subject
.
label
).
to
eq
'manual play action'
}
end
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_manual'
}
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'manual'
}
end
describe
'action details'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:build
)
{
create
(
:ci_build
)
}
...
...
spec/lib/gitlab/ci/status/build/stop_spec.rb
View file @
bb2460c1
...
...
@@ -8,22 +8,10 @@ describe Gitlab::Ci::Status::Build::Stop do
described_class
.
new
(
status
)
end
describe
'#text'
do
it
{
expect
(
subject
.
text
).
to
eq
'manual'
}
end
describe
'#label'
do
it
{
expect
(
subject
.
label
).
to
eq
'manual stop action'
}
end
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_manual'
}
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'manual'
}
end
describe
'action details'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:build
)
{
create
(
:ci_build
)
}
...
...
spec/lib/gitlab/ci/status/canceled_spec.rb
View file @
bb2460c1
...
...
@@ -6,7 +6,7 @@ describe Gitlab::Ci::Status::Canceled do
end
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'canceled'
}
it
{
expect
(
subject
.
text
).
to
eq
'canceled'
}
end
describe
'#label'
do
...
...
spec/lib/gitlab/ci/status/created_spec.rb
View file @
bb2460c1
...
...
@@ -6,7 +6,7 @@ describe Gitlab::Ci::Status::Created do
end
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'created'
}
it
{
expect
(
subject
.
text
).
to
eq
'created'
}
end
describe
'#label'
do
...
...
spec/lib/gitlab/ci/status/failed_spec.rb
View file @
bb2460c1
...
...
@@ -6,7 +6,7 @@ describe Gitlab::Ci::Status::Failed do
end
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'failed'
}
it
{
expect
(
subject
.
text
).
to
eq
'failed'
}
end
describe
'#label'
do
...
...
spec/lib/gitlab/ci/status/manual_spec.rb
0 → 100644
View file @
bb2460c1
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Manual
do
subject
do
described_class
.
new
(
double
(
'subject'
),
double
(
'user'
))
end
describe
'#text'
do
it
{
expect
(
subject
.
text
).
to
eq
'manual'
}
end
describe
'#label'
do
it
{
expect
(
subject
.
label
).
to
eq
'manual action'
}
end
describe
'#icon'
do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_manual'
}
end
describe
'#group'
do
it
{
expect
(
subject
.
group
).
to
eq
'manual'
}
end
end
spec/lib/gitlab/ci/status/pending_spec.rb
View file @
bb2460c1
...
...
@@ -6,7 +6,7 @@ describe Gitlab::Ci::Status::Pending do
end
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'pending'
}
it
{
expect
(
subject
.
text
).
to
eq
'pending'
}
end
describe
'#label'
do
...
...
spec/lib/gitlab/ci/status/running_spec.rb
View file @
bb2460c1
...
...
@@ -6,7 +6,7 @@ describe Gitlab::Ci::Status::Running do
end
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'running'
}
it
{
expect
(
subject
.
text
).
to
eq
'running'
}
end
describe
'#label'
do
...
...
spec/lib/gitlab/ci/status/skipped_spec.rb
View file @
bb2460c1
...
...
@@ -6,7 +6,7 @@ describe Gitlab::Ci::Status::Skipped do
end
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'skipped'
}
it
{
expect
(
subject
.
text
).
to
eq
'skipped'
}
end
describe
'#label'
do
...
...
spec/lib/gitlab/ci/status/success_spec.rb
View file @
bb2460c1
...
...
@@ -6,7 +6,7 @@ describe Gitlab::Ci::Status::Success do
end
describe
'#text'
do
it
{
expect
(
subject
.
label
).
to
eq
'passed'
}
it
{
expect
(
subject
.
text
).
to
eq
'passed'
}
end
describe
'#label'
do
...
...
spec/models/ci/pipeline_spec.rb
View file @
bb2460c1
...
...
@@ -643,6 +643,14 @@ describe Ci::Pipeline, models: true do
end
end
context
'when pipeline is blocked'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
status: :manual
)
}
it
'returns detailed status for blocked pipeline'
do
expect
(
subject
.
text
).
to
eq
'manual'
end
end
context
'when pipeline is successful but with warnings'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
status: :success
)
}
...
...
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