BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e5f24c54
Commit
e5f24c54
authored
May 05, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for extended status for manual actions
parent
55cec217
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
action_spec.rb
spec/lib/gitlab/ci/status/build/action_spec.rb
+56
-0
No files found.
spec/lib/gitlab/ci/status/build/action_spec.rb
0 → 100644
View file @
e5f24c54
require
'spec_helper'
describe
Gitlab
::
Ci
::
Status
::
Build
::
Action
do
let
(
:status
)
{
double
(
'core status'
)
}
let
(
:user
)
{
double
(
'user'
)
}
subject
do
described_class
.
new
(
status
)
end
describe
'#label'
do
before
do
allow
(
status
).
to
receive
(
:label
).
and_return
(
'label'
)
end
context
'when status has action'
do
before
do
allow
(
status
).
to
receive
(
:has_action?
).
and_return
(
true
)
end
it
'does not append text'
do
expect
(
subject
.
label
).
to
eq
'label'
end
end
context
'when status does not have action'
do
before
do
allow
(
status
).
to
receive
(
:has_action?
).
and_return
(
false
)
end
it
'appends text about action not allowed'
do
expect
(
subject
.
label
).
to
eq
'label (not allowed)'
end
end
end
describe
'.matches?'
do
subject
{
described_class
.
matches?
(
build
,
user
)
}
context
'when build is an action'
do
let
(
:build
)
{
create
(
:ci_build
,
:manual
)
}
it
'is a correct match'
do
expect
(
subject
).
to
be
true
end
end
context
'when build is not manual'
do
let
(
:build
)
{
create
(
:ci_build
)
}
it
'does not match'
do
expect
(
subject
).
to
be
false
end
end
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