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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
adf82f85
Commit
adf82f85
authored
Feb 04, 2020
by
Tetiana Chupryna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for `expose_security_dashboard?`
parent
952e3d0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
ee/spec/presenters/ci/pipeline_presenter_spec.rb
ee/spec/presenters/ci/pipeline_presenter_spec.rb
+25
-5
No files found.
ee/spec/presenters/ci/pipeline_presenter_spec.rb
View file @
adf82f85
...
...
@@ -4,13 +4,11 @@ require 'spec_helper'
describe
Ci
::
PipelinePresenter
do
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
let_it_be
(
:pipeline
,
reload:
true
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let_it_be
(
:pipeline
,
reload:
true
)
{
create
(
:
ee_
ci_pipeline
,
project:
project
)
}
subject
(
:presenter
)
do
described_class
.
new
(
pipeline
)
end
let
(
:presenter
)
{
described_class
.
new
(
pipeline
)
}
describe
'
.
failure_reason'
do
describe
'
#
failure_reason'
do
context
'when pipeline has failure reason'
do
it
'represents a failure reason sentence'
do
pipeline
.
failure_reason
=
:activity_limit_exceeded
...
...
@@ -26,4 +24,26 @@ describe Ci::PipelinePresenter do
end
end
end
describe
'#expose_security_dashboard?'
do
subject
{
pipeline
.
expose_security_dashboard?
}
context
'when there is an artifact of a right type'
do
let!
(
:build
)
{
create
(
:ee_ci_build
,
:dependency_scanning
,
pipeline:
pipeline
)
}
it
{
is_expected
.
to
be_truthy
}
end
context
'when there is an artifact of a wrong type'
do
let!
(
:build
)
{
create
(
:ee_ci_build
,
:license_scanning
,
pipeline:
pipeline
)
}
it
{
is_expected
.
to
be_falsey
}
end
context
'when there is no found artifact'
do
let!
(
:build
)
{
create
(
:ee_ci_build
,
pipeline:
pipeline
)
}
it
{
is_expected
.
to
be_falsey
}
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