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
c278de44
Commit
c278de44
authored
Jan 26, 2021
by
Serena Fang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for non licensed audit events
parent
a6c477ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
spec/services/resource_access_tokens/create_service_spec.rb
spec/services/resource_access_tokens/create_service_spec.rb
+10
-0
spec/services/resource_access_tokens/revoke_service_spec.rb
spec/services/resource_access_tokens/revoke_service_spec.rb
+10
-0
No files found.
spec/services/resource_access_tokens/create_service_spec.rb
View file @
c278de44
...
...
@@ -203,6 +203,16 @@ RSpec.describe ResourceAccessTokens::CreateService do
expect
(
Gitlab
::
AppLogger
).
to
have_received
(
:info
).
with
(
/PROJECT ACCESS TOKEN CREATION: created_by:
#{
user
.
username
}
, project_id:
#{
resource
.
id
}
, token_user:
#{
response
.
payload
[
:access_token
].
user
.
name
}
, token_id: \d+/
)
end
context
'audit events when not licensed'
do
before
do
stub_licensed_features
(
audit_events:
false
)
end
it
'does not log any audit event'
do
expect
{
subject
}.
not_to
change
{
AuditEvent
.
count
}
end
end
end
context
'when resource is a project'
do
...
...
spec/services/resource_access_tokens/revoke_service_spec.rb
View file @
c278de44
...
...
@@ -48,6 +48,16 @@ RSpec.describe ResourceAccessTokens::RevokeService do
expect
(
Gitlab
::
AppLogger
).
to
have_received
(
:info
).
with
(
"PROJECT ACCESS TOKEN REVOCATION: revoked_by:
#{
user
.
username
}
, project_id:
#{
resource
.
id
}
, token_user:
#{
resource_bot
.
name
}
, token_id:
#{
access_token
.
id
}
"
)
end
context
'audit events when not licensed'
do
before
do
stub_licensed_features
(
audit_events:
false
)
end
it
'does not log any audit event'
do
expect
{
subject
}.
not_to
change
{
AuditEvent
.
count
}
end
end
end
shared_examples
'rollback revoke steps'
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