expect(audit_event.details[:custom_message]).toeq("Created project access token with id: #{response.payload[:access_token].user.id} with scopes: #{response.payload[:access_token].scopes}")
expect(audit_event.details[:custom_message]).toeq("Created project access token with token_id: #{response.payload[:access_token].id} with scopes: #{response.payload[:access_token].scopes}")
@@ -56,7 +56,7 @@ RSpec.describe ResourceAccessTokens::RevokeService do
it'logs the find error message'do
subject
expect(AuditEvent.where(author_id: user.id).last.details[:custom_message]).tomatch(/Attempted to revoke project access token with id: \d+, but failed with message: Failed to find bot user/)
expect(AuditEvent.where(author_id: user.id).last.details[:custom_message]).tomatch(/Attempted to revoke project access token with token_id: \d+, but failed with message: Failed to find bot user/)
end
end
...
...
@@ -71,7 +71,7 @@ RSpec.describe ResourceAccessTokens::RevokeService do
it'logs the permission error message'do
subject
expect(AuditEvent.where(author_id: user.id).last.details[:custom_message]).tomatch(/Attempted to revoke project access token with id: \d+, but failed with message: #{user.name} cannot delete #{access_token.user.name}/)
expect(AuditEvent.where(author_id: user.id).last.details[:custom_message]).tomatch(/Attempted to revoke project access token with token_id: \d+, but failed with message: #{user.name} cannot delete #{access_token.user.name}/)