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
83a33764
Commit
83a33764
authored
Nov 19, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable audit logs in DestroyPipeline specs
parent
5bf6088f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
spec/requests/api/pipelines_spec.rb
spec/requests/api/pipelines_spec.rb
+9
-2
spec/services/ci/destroy_pipeline_service_spec.rb
spec/services/ci/destroy_pipeline_service_spec.rb
+9
-2
No files found.
spec/requests/api/pipelines_spec.rb
View file @
83a33764
...
...
@@ -456,8 +456,15 @@ describe API::Pipelines do
expect
(
json_response
[
'message'
]).
to
eq
'404 Not found'
end
it
'logs an audit event'
do
expect
{
delete
api
(
"/projects/
#{
project
.
id
}
/pipelines/
#{
pipeline
.
id
}
"
,
owner
)
}.
to
change
{
SecurityEvent
.
count
}.
by
(
1
)
context
'when audit events is enabled'
do
before
do
allow
(
License
).
to
receive
(
:feature_available?
).
and_call_original
allow
(
License
).
to
receive
(
:feature_available?
).
with
(
:extended_audit_events
).
and_return
(
true
)
end
it
'logs an audit event'
do
expect
{
delete
api
(
"/projects/
#{
project
.
id
}
/pipelines/
#{
pipeline
.
id
}
"
,
owner
)
}.
to
change
{
SecurityEvent
.
count
}.
by
(
1
)
end
end
context
'when the pipeline has jobs'
do
...
...
spec/services/ci/destroy_pipeline_service_spec.rb
View file @
83a33764
...
...
@@ -17,8 +17,15 @@ describe ::Ci::DestroyPipelineService do
expect
{
pipeline
.
reload
}.
to
raise_error
(
ActiveRecord
::
RecordNotFound
)
end
it
'logs an audit event'
do
expect
{
subject
}.
to
change
{
SecurityEvent
.
count
}.
by
(
1
)
context
'when audit events is enabled'
do
before
do
allow
(
License
).
to
receive
(
:feature_available?
).
and_call_original
allow
(
License
).
to
receive
(
:feature_available?
).
with
(
:extended_audit_events
).
and_return
(
true
)
end
it
'logs an audit event'
do
expect
{
subject
}.
to
change
{
SecurityEvent
.
count
}.
by
(
1
)
end
end
context
'when the pipeline has jobs'
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