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
4df61428
Commit
4df61428
authored
Nov 22, 2021
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mock with specific project instance
parent
ae5a198e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
ee/spec/controllers/projects/security/vulnerabilities_controller_spec.rb
...lers/projects/security/vulnerabilities_controller_spec.rb
+2
-2
No files found.
ee/spec/controllers/projects/security/vulnerabilities_controller_spec.rb
View file @
4df61428
...
@@ -20,7 +20,7 @@ RSpec.describe Projects::Security::VulnerabilitiesController do
...
@@ -20,7 +20,7 @@ RSpec.describe Projects::Security::VulnerabilitiesController do
before
do
before
do
allow
(
controller
).
to
receive
(
:can?
).
and_call_original
allow
(
controller
).
to
receive
(
:can?
).
and_call_original
allow
(
controller
).
to
receive
(
:can?
).
with
(
controller
.
current_user
,
:create_vulnerability
,
an_instance_of
(
Project
)
).
and_return
(
can_create_vulnerability
)
allow
(
controller
).
to
receive
(
:can?
).
with
(
controller
.
current_user
,
:create_vulnerability
,
project
).
and_return
(
can_create_vulnerability
)
end
end
include_context
'"Security & Compliance" permissions'
do
include_context
'"Security & Compliance" permissions'
do
...
@@ -31,7 +31,7 @@ RSpec.describe Projects::Security::VulnerabilitiesController do
...
@@ -31,7 +31,7 @@ RSpec.describe Projects::Security::VulnerabilitiesController do
it
'checks if the user can create a vulnerability'
do
it
'checks if the user can create a vulnerability'
do
request_new_vulnerability_page
request_new_vulnerability_page
expect
(
controller
).
to
have_received
(
:can?
).
with
(
controller
.
current_user
,
:create_vulnerability
,
an_instance_of
(
Project
)
)
expect
(
controller
).
to
have_received
(
:can?
).
with
(
controller
.
current_user
,
:create_vulnerability
,
project
)
end
end
context
'when user can create vulnerability'
do
context
'when user can create vulnerability'
do
...
...
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