Commit c278de44 authored by Serena Fang's avatar Serena Fang

Add specs for non licensed audit events

parent a6c477ec
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment