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
Jérome Perrin
gitlab-ce
Commits
65c3bfe6
Commit
65c3bfe6
authored
Dec 13, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend specs for build play/stop detailed statuses
parent
48d43608
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
7 deletions
+55
-7
spec/lib/gitlab/ci/status/build/play_spec.rb
spec/lib/gitlab/ci/status/build/play_spec.rb
+30
-0
spec/lib/gitlab/ci/status/build/stop_spec.rb
spec/lib/gitlab/ci/status/build/stop_spec.rb
+25
-7
No files found.
spec/lib/gitlab/ci/status/build/play_spec.rb
View file @
65c3bfe6
...
...
@@ -18,6 +18,36 @@ describe Gitlab::Ci::Status::Build::Play do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_manual'
}
end
describe
'action details'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:build
)
{
create
(
:ci_build
)
}
let
(
:status
)
{
Gitlab
::
Ci
::
Status
::
Core
.
new
(
build
,
user
)
}
describe
'#has_action?'
do
context
'when user is allowed to update build'
do
before
{
build
.
project
.
team
<<
[
user
,
:developer
]
}
it
{
is_expected
.
to
have_action
}
end
context
'when user is not allowed to update build'
do
it
{
is_expected
.
not_to
have_action
}
end
end
describe
'#action_path'
do
it
{
expect
(
subject
.
action_path
).
to
include
"
#{
build
.
id
}
/play"
}
end
describe
'#action_icon'
do
it
{
expect
(
subject
.
action_icon
).
to
eq
'play'
}
end
describe
'#action_title'
do
it
{
expect
(
subject
.
action_title
).
to
eq
'Play'
}
end
end
describe
'.matches?'
do
subject
{
described_class
.
matches?
(
build
,
user
)
}
...
...
spec/lib/gitlab/ci/status/build/stop_spec.rb
View file @
65c3bfe6
...
...
@@ -20,16 +20,34 @@ describe Gitlab::Ci::Status::Build::Stop do
it
{
expect
(
subject
.
icon
).
to
eq
'icon_status_manual'
}
end
describe
'#has_action?'
do
end
describe
'action details'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:build
)
{
create
(
:ci_build
)
}
let
(
:status
)
{
Gitlab
::
Ci
::
Status
::
Core
.
new
(
build
,
user
)
}
describe
'#action_icon'
do
end
describe
'#has_action?'
do
context
'when user is allowed to update build'
do
before
{
build
.
project
.
team
<<
[
user
,
:developer
]
}
describe
'#action_path'
do
end
it
{
is_expected
.
to
have_action
}
end
context
'when user is not allowed to update build'
do
it
{
is_expected
.
not_to
have_action
}
end
end
describe
'#action_path'
do
it
{
expect
(
subject
.
action_path
).
to
include
"
#{
build
.
id
}
/play"
}
end
describe
'#action_title'
do
describe
'#action_icon'
do
it
{
expect
(
subject
.
action_icon
).
to
eq
'stop'
}
end
describe
'#action_title'
do
it
{
expect
(
subject
.
action_title
).
to
eq
'Stop'
}
end
end
describe
'.matches?'
do
...
...
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