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
4c43ce1e
Commit
4c43ce1e
authored
Oct 02, 2018
by
Olivier Gonzalez
Committed by
Robert Speicher
Oct 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove condition on Security Dashboard quicklink
parent
e672c821
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
21 deletions
+9
-21
ee/app/presenters/ee/project_presenter.rb
ee/app/presenters/ee/project_presenter.rb
+1
-2
ee/spec/presenters/project_presenter_spec.rb
ee/spec/presenters/project_presenter_spec.rb
+8
-19
No files found.
ee/app/presenters/ee/project_presenter.rb
View file @
4c43ce1e
...
...
@@ -12,8 +12,7 @@ module EE
def
extra_statistics_anchors
anchors
=
[]
if
can?
(
current_user
,
:read_project_security_dashboard
,
project
)
&&
project
.
latest_pipeline_with_security_reports
if
can?
(
current_user
,
:read_project_security_dashboard
,
project
)
anchors
<<
security_dashboard_data
end
...
...
ee/spec/presenters/project_presenter_spec.rb
View file @
4c43ce1e
...
...
@@ -18,18 +18,13 @@ describe ProjectPresenter do
link:
project_security_dashboard_path
(
project
))
end
before
do
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_project_security_dashboard
,
project
).
and_return
(
true
)
allow
(
project
).
to
receive
(
:latest_pipeline_with_security_reports
).
and_return
(
pipeline
)
end
it
'has security dashboard link'
do
expect
(
presenter
.
extra_statistics_anchors
).
to
include
(
security_dashboard_data
)
end
context
'user is allowed to read security dashboard'
do
before
do
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_project_security_dashboard
,
project
).
and_return
(
true
)
end
shared_examples
'has no security dashboard link'
do
it
do
expect
(
presenter
.
extra_statistics_anchors
).
not_to
include
(
security_dashboard_data
)
it
'has security dashboard link'
do
expect
(
presenter
.
extra_statistics_anchors
).
to
include
(
security_dashboard_data
)
end
end
...
...
@@ -38,15 +33,9 @@ describe ProjectPresenter do
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_project_security_dashboard
,
project
).
and_return
(
false
)
end
it_behaves_like
'has no security dashboard link'
end
context
'no pipeline having security reports'
do
before
do
allow
(
project
).
to
receive
(
:latest_pipeline_with_security_reports
).
and_return
(
nil
)
it
'has no security dashboard link'
do
expect
(
presenter
.
extra_statistics_anchors
).
not_to
include
(
security_dashboard_data
)
end
it_behaves_like
'has no security dashboard link'
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