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
233fdeb8
Commit
233fdeb8
authored
Jan 31, 2020
by
Tetiana Chupryna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test EE functionality in module test
parent
146eef9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
38 deletions
+33
-38
ee/spec/models/ci/job_artifact_spec.rb
ee/spec/models/ci/job_artifact_spec.rb
+0
-38
ee/spec/models/ee/ci/job_artifact_spec.rb
ee/spec/models/ee/ci/job_artifact_spec.rb
+33
-0
No files found.
ee/spec/models/ci/job_artifact_spec.rb
deleted
100644 → 0
View file @
146eef9f
# frozen_string_literal: true
require
'spec_helper'
describe
Ci
::
JobArtifact
do
include
EE
::
GeoHelpers
describe
'#destroy'
do
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
it
'creates a JobArtifactDeletedEvent'
do
stub_current_geo_node
(
primary
)
job_artifact
=
create
(
:ci_job_artifact
,
:archive
)
expect
do
job_artifact
.
destroy
end
.
to
change
{
Geo
::
JobArtifactDeletedEvent
.
count
}.
by
(
1
)
end
end
describe
'.security_reports'
do
subject
{
described_class
.
security_reports
}
context
'when there is a security report'
do
let!
(
:artifact
)
{
create
(
:ee_ci_job_artifact
,
:sast
)
}
it
{
is_expected
.
to
eq
([
artifact
])
}
end
context
'when there are no security reports'
do
let!
(
:artifact
)
{
create
(
:ci_job_artifact
,
:archive
)
}
it
{
is_expected
.
to
be_empty
}
end
end
end
ee/spec/models/ee/ci/job_artifact_spec.rb
View file @
233fdeb8
...
...
@@ -3,6 +3,23 @@
require
'spec_helper'
describe
EE
::
Ci
::
JobArtifact
do
include
EE
::
GeoHelpers
describe
'#destroy'
do
let_it_be
(
:primary
)
{
create
(
:geo_node
,
:primary
)
}
let_it_be
(
:secondary
)
{
create
(
:geo_node
)
}
it
'creates a JobArtifactDeletedEvent'
do
stub_current_geo_node
(
primary
)
job_artifact
=
create
(
:ee_ci_job_artifact
,
:archive
)
expect
do
job_artifact
.
destroy
end
.
to
change
{
Geo
::
JobArtifactDeletedEvent
.
count
}.
by
(
1
)
end
end
describe
'.license_scanning_reports'
do
subject
{
Ci
::
JobArtifact
.
license_scanning_reports
}
...
...
@@ -35,6 +52,22 @@ describe EE::Ci::JobArtifact do
end
end
describe
'.security_reports'
do
subject
{
Ci
::
JobArtifact
.
security_reports
}
context
'when there is a security report'
do
let!
(
:artifact
)
{
create
(
:ee_ci_job_artifact
,
:sast
)
}
it
{
is_expected
.
to
eq
([
artifact
])
}
end
context
'when there are no security reports'
do
let!
(
:artifact
)
{
create
(
:ci_job_artifact
,
:archive
)
}
it
{
is_expected
.
to
be_empty
}
end
end
describe
'.associated_file_types_for'
do
using
RSpec
::
Parameterized
::
TableSyntax
...
...
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