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
fd333b8d
Commit
fd333b8d
authored
Mar 14, 2018
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve tests for security report page
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
3a6ef0ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
9 deletions
+45
-9
ee/spec/controllers/projects/pipelines_controller_spec.rb
ee/spec/controllers/projects/pipelines_controller_spec.rb
+42
-9
ee/spec/features/projects/pipelines/pipeline_spec.rb
ee/spec/features/projects/pipelines/pipeline_spec.rb
+3
-0
No files found.
ee/spec/controllers/projects/pipelines_controller_spec.rb
View file @
fd333b8d
...
...
@@ -17,6 +17,7 @@ describe Projects::PipelinesController do
before
do
create
(
:ci_build
,
:success
,
:artifacts
,
name:
'sast'
,
pipeline:
pipeline
,
...
...
@@ -26,24 +27,56 @@ describe Projects::PipelinesController do
}
}
)
end
context
'with feature enabled'
do
before
do
allow
(
License
).
to
receive
(
:feature_available?
).
and_return
(
true
)
get
:security
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
pipeline
get
:security
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
pipeline
end
it
do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
render_template
:show
end
end
it
do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
render_template
:show
context
'with feature disabled'
do
before
do
get
:security
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
pipeline
end
it
do
expect
(
response
).
to
have_gitlab_http_status
(
:redirect
)
expect
(
response
).
to
redirect_to
(
pipeline_path
(
pipeline
))
end
end
end
context
'without sast artifact'
do
before
do
get
:security
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
pipeline
context
'with feature enabled'
do
before
do
allow
(
License
).
to
receive
(
:feature_available?
).
and_return
(
true
)
get
:security
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
pipeline
end
it
do
expect
(
response
).
to
have_gitlab_http_status
(
:redirect
)
expect
(
response
).
to
redirect_to
(
pipeline_path
(
pipeline
))
end
end
it
do
expect
(
response
).
to
have_gitlab_http_status
(
:redirect
)
expect
(
response
).
to
redirect_to
(
pipeline_path
(
pipeline
))
context
'with feature disabled'
do
before
do
get
:security
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
pipeline
end
it
do
expect
(
response
).
to
have_gitlab_http_status
(
:redirect
)
expect
(
response
).
to
redirect_to
(
pipeline_path
(
pipeline
))
end
end
end
end
...
...
ee/spec/features/projects/pipelines/pipeline_spec.rb
View file @
fd333b8d
...
...
@@ -7,6 +7,8 @@ describe 'Pipeline', :js do
before
do
sign_in
(
user
)
project
.
add_developer
(
user
)
allow
(
License
).
to
receive
(
:feature_available?
).
and_return
(
true
)
end
describe
'GET /:project/pipelines/:id/security'
do
...
...
@@ -16,6 +18,7 @@ describe 'Pipeline', :js do
before
do
create
(
:ci_build
,
:success
,
:artifacts
,
name:
'sast'
,
pipeline:
pipeline
,
...
...
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