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
b7a58d83
Commit
b7a58d83
authored
May 16, 2018
by
Gilbert Roulot
Committed by
Robert Speicher
May 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
5943 improve license management tests
parent
b40594d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
25 deletions
+39
-25
ee/spec/serializers/merge_request_widget_entity_spec.rb
ee/spec/serializers/merge_request_widget_entity_spec.rb
+39
-25
No files found.
ee/spec/serializers/merge_request_widget_entity_spec.rb
View file @
b7a58d83
...
...
@@ -16,8 +16,10 @@ describe MergeRequestWidgetEntity do
end
it
'has blob path data'
do
allow
(
merge_request
).
to
receive
(
:base_pipeline
).
and_return
(
pipeline
)
allow
(
merge_request
).
to
receive
(
:head_pipeline
).
and_return
(
pipeline
)
allow
(
merge_request
).
to
receive_messages
(
base_pipeline:
pipeline
,
head_pipeline:
pipeline
)
expect
(
subject
.
as_json
).
to
include
(
:blob_path
)
expect
(
subject
.
as_json
[
:blob_path
]).
to
include
(
:base_path
)
...
...
@@ -27,9 +29,11 @@ describe MergeRequestWidgetEntity do
it
'has performance data'
do
build
=
create
(
:ci_build
,
name:
'job'
)
allow
(
merge_request
).
to
receive
(
:expose_performance_data?
).
and_return
(
true
)
allow
(
merge_request
).
to
receive
(
:base_performance_artifact
).
and_return
(
build
)
allow
(
merge_request
).
to
receive
(
:head_performance_artifact
).
and_return
(
build
)
allow
(
merge_request
).
to
receive_messages
(
expose_performance_data?:
true
,
base_performance_artifact:
build
,
head_performance_artifact:
build
)
expect
(
subject
.
as_json
).
to
include
(
:performance
)
end
...
...
@@ -37,10 +41,12 @@ describe MergeRequestWidgetEntity do
it
'has sast data'
do
build
=
create
(
:ci_build
,
name:
'sast'
,
pipeline:
pipeline
)
allow
(
merge_request
).
to
receive
(
:expose_sast_data?
).
and_return
(
true
)
allow
(
merge_request
).
to
receive
(
:base_has_sast_data?
).
and_return
(
true
)
allow
(
merge_request
).
to
receive
(
:base_sast_artifact
).
and_return
(
build
)
allow
(
merge_request
).
to
receive
(
:head_sast_artifact
).
and_return
(
build
)
allow
(
merge_request
).
to
receive_messages
(
expose_sast_data?:
true
,
base_has_sast_data?:
true
,
base_sast_artifact:
build
,
head_sast_artifact:
build
)
expect
(
subject
.
as_json
).
to
include
(
:sast
)
expect
(
subject
.
as_json
[
:sast
]).
to
include
(
:head_path
)
...
...
@@ -50,10 +56,12 @@ describe MergeRequestWidgetEntity do
it
'has dependency_scanning data'
do
build
=
create
(
:ci_build
,
name:
'dependency_scanning'
,
pipeline:
pipeline
)
allow
(
merge_request
).
to
receive
(
:expose_dependency_scanning_data?
).
and_return
(
true
)
allow
(
merge_request
).
to
receive
(
:base_has_dependency_scanning_data?
).
and_return
(
true
)
allow
(
merge_request
).
to
receive
(
:base_dependency_scanning_artifact
).
and_return
(
build
)
allow
(
merge_request
).
to
receive
(
:head_dependency_scanning_artifact
).
and_return
(
build
)
allow
(
merge_request
).
to
receive_messages
(
expose_dependency_scanning_data?:
true
,
base_has_dependency_scanning_data?:
true
,
base_dependency_scanning_artifact:
build
,
head_dependency_scanning_artifact:
build
)
expect
(
subject
.
as_json
).
to
include
(
:dependency_scanning
)
expect
(
subject
.
as_json
[
:dependency_scanning
]).
to
include
(
:head_path
)
...
...
@@ -63,10 +71,12 @@ describe MergeRequestWidgetEntity do
it
'has license_management data'
do
build
=
create
(
:ci_build
,
name:
'license_management'
,
pipeline:
pipeline
)
allow
(
merge_request
).
to
receive
(
:expose_license_management_data?
).
and_return
(
true
)
allow
(
merge_request
).
to
receive
(
:base_has_license_management_data?
).
and_return
(
true
)
allow
(
merge_request
).
to
receive
(
:base_license_management_artifact
).
and_return
(
build
)
allow
(
merge_request
).
to
receive
(
:head_license_management_artifact
).
and_return
(
build
)
allow
(
merge_request
).
to
receive_messages
(
expose_license_management_data?:
true
,
base_has_license_management_data?:
true
,
base_license_management_artifact:
build
,
head_license_management_artifact:
build
)
expect
(
subject
.
as_json
).
to
include
(
:license_management
)
expect
(
subject
.
as_json
[
:license_management
]).
to
include
(
:head_path
)
...
...
@@ -76,10 +86,12 @@ describe MergeRequestWidgetEntity do
it
'has sast_container data'
do
build
=
create
(
:ci_build
,
name:
'sast:image'
,
pipeline:
pipeline
)
allow
(
merge_request
).
to
receive
(
:expose_sast_container_data?
).
and_return
(
true
)
allow
(
merge_request
).
to
receive
(
:base_has_sast_container_data?
).
and_return
(
true
)
allow
(
merge_request
).
to
receive
(
:base_sast_container_artifact
).
and_return
(
build
)
allow
(
merge_request
).
to
receive
(
:head_sast_container_artifact
).
and_return
(
build
)
allow
(
merge_request
).
to
receive_messages
(
expose_sast_container_data?:
true
,
base_has_sast_container_data?:
true
,
base_sast_container_artifact:
build
,
head_sast_container_artifact:
build
)
expect
(
subject
.
as_json
).
to
include
(
:sast_container
)
expect
(
subject
.
as_json
[
:sast_container
]).
to
include
(
:head_path
)
...
...
@@ -89,10 +101,12 @@ describe MergeRequestWidgetEntity do
it
'has dast data'
do
build
=
create
(
:ci_build
,
name:
'dast'
,
pipeline:
pipeline
)
allow
(
merge_request
).
to
receive
(
:expose_dast_data?
).
and_return
(
true
)
allow
(
merge_request
).
to
receive
(
:base_has_dast_data?
).
and_return
(
true
)
allow
(
merge_request
).
to
receive
(
:base_dast_artifact
).
and_return
(
build
)
allow
(
merge_request
).
to
receive
(
:head_dast_artifact
).
and_return
(
build
)
allow
(
merge_request
).
to
receive_messages
(
expose_dast_data?:
true
,
base_has_dast_data?:
true
,
base_dast_artifact:
build
,
head_dast_artifact:
build
)
expect
(
subject
.
as_json
).
to
include
(
:dast
)
expect
(
subject
.
as_json
[
:dast
]).
to
include
(
:head_path
)
...
...
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