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
...
@@ -12,8 +12,7 @@ module EE
def
extra_statistics_anchors
def
extra_statistics_anchors
anchors
=
[]
anchors
=
[]
if
can?
(
current_user
,
:read_project_security_dashboard
,
project
)
&&
if
can?
(
current_user
,
:read_project_security_dashboard
,
project
)
project
.
latest_pipeline_with_security_reports
anchors
<<
security_dashboard_data
anchors
<<
security_dashboard_data
end
end
...
...
ee/spec/presenters/project_presenter_spec.rb
View file @
4c43ce1e
...
@@ -18,18 +18,13 @@ describe ProjectPresenter do
...
@@ -18,18 +18,13 @@ describe ProjectPresenter do
link:
project_security_dashboard_path
(
project
))
link:
project_security_dashboard_path
(
project
))
end
end
before
do
context
'user is allowed to read security dashboard'
do
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_project_security_dashboard
,
project
).
and_return
(
true
)
before
do
allow
(
project
).
to
receive
(
:latest_pipeline_with_security_reports
).
and_return
(
pipeline
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_project_security_dashboard
,
project
).
and_return
(
true
)
end
end
it
'has security dashboard link'
do
expect
(
presenter
.
extra_statistics_anchors
).
to
include
(
security_dashboard_data
)
end
shared_examples
'has no security dashboard link'
do
it
'has security dashboard link'
do
it
do
expect
(
presenter
.
extra_statistics_anchors
).
to
include
(
security_dashboard_data
)
expect
(
presenter
.
extra_statistics_anchors
).
not_to
include
(
security_dashboard_data
)
end
end
end
end
...
@@ -38,15 +33,9 @@ describe ProjectPresenter do
...
@@ -38,15 +33,9 @@ describe ProjectPresenter do
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_project_security_dashboard
,
project
).
and_return
(
false
)
allow
(
Ability
).
to
receive
(
:allowed?
).
with
(
user
,
:read_project_security_dashboard
,
project
).
and_return
(
false
)
end
end
it_behaves_like
'has no security dashboard link'
it
'has no security dashboard link'
do
end
expect
(
presenter
.
extra_statistics_anchors
).
not_to
include
(
security_dashboard_data
)
context
'no pipeline having security reports'
do
before
do
allow
(
project
).
to
receive
(
:latest_pipeline_with_security_reports
).
and_return
(
nil
)
end
end
it_behaves_like
'has no security dashboard link'
end
end
end
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