Commit 7dbf114f authored by Bob Van Landuyt's avatar Bob Van Landuyt

Use the correct project visibility in system hooks

parent 6d7384f5
...@@ -83,7 +83,7 @@ class SystemHooksService ...@@ -83,7 +83,7 @@ class SystemHooksService
project_id: model.id, project_id: model.id,
owner_name: owner.name, owner_name: owner.name,
owner_email: owner.respond_to?(:email) ? owner.email : "", owner_email: owner.respond_to?(:email) ? owner.email : "",
project_visibility: Project.visibility_levels.key(model.visibility_level_value).downcase project_visibility: model.visibility.downcase
} }
end end
......
---
title: Use the correct visibility attribute for projects in system hooks
merge_request: 15065
author:
type: fixed
...@@ -63,6 +63,12 @@ describe SystemHooksService do ...@@ -63,6 +63,12 @@ describe SystemHooksService do
:group_id, :user_id, :user_username, :user_name, :user_email, :group_access :group_id, :user_id, :user_username, :user_name, :user_email, :group_access
) )
end end
it 'includes the correct project visibility level' do
data = event_data(project, :create)
expect(data[:project_visibility]).to eq('private')
end
end end
context 'event names' do context 'event names' 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