@@ -101,7 +101,7 @@ RSpec.describe ResourceAccessTokens::CreateService do
it'logs the permission error message'do
subject
expect(AuditEvent.last.details[:custom_message]).toeq('Attempted to create project access token but failed with message: User does not have permission to create project access token')
expect(AuditEvent.where(author_id: user.id).last.details[:custom_message]).toeq('Attempted to create project access token but failed with message: User does not have permission to create project access token')
end
end
...
...
@@ -123,7 +123,7 @@ RSpec.describe ResourceAccessTokens::CreateService do
it'logs the provisioning error message'do
subject
expect(AuditEvent.last.details[:custom_message]).toeq('Attempted to create project access token but failed with message: Could not provision maintainer access to project access token')
expect(AuditEvent.where(author_id: user.id).last.details[:custom_message]).toeq('Attempted to create project access token but failed with message: Could not provision maintainer access to project access token')
@@ -56,7 +56,7 @@ RSpec.describe ResourceAccessTokens::RevokeService do
it'logs the find error message'do
subject
expect(AuditEvent.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 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.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 id: \d+, but failed with message: #{user.name} cannot delete #{access_token.user.name}/)