Commit d6825da3 authored by serenafang's avatar serenafang

Add expires_at to group member builder data

parent d89f1742
......@@ -19,6 +19,7 @@ module Gitlab
# :group_access=>"Guest",
# :created_at=>"2020-11-04T10:12:10Z",
# :updated_at=>"2020-11-04T10:12:10Z",
# :expires_at=>"2020-12-04T10:12:10Z"
# }
def build(event)
......@@ -40,7 +41,8 @@ module Gitlab
user_name: group_member.user.name,
user_email: group_member.user.email,
user_id: group_member.user.id,
group_access: group_member.human_access
group_access: group_member.human_access,
expires_at: group_member.expires_at&.xmlschema
}
end
......
......@@ -11,7 +11,7 @@ RSpec.describe Gitlab::HookData::GroupMemberBuilder do
let(:event_name) { data[:event_name] }
let(:attributes) do
[
:event_name, :created_at, :updated_at, :group_name, :group_path,
:event_name, :created_at, :updated_at, :expires_at, :group_name, :group_path,
:group_id, :user_id, :user_username, :user_name, :user_email, :group_access
]
end
......@@ -31,6 +31,7 @@ RSpec.describe Gitlab::HookData::GroupMemberBuilder do
expect(data[:group_access]).to eq('Developer')
expect(data[:created_at]).to eq(group_member.created_at&.xmlschema)
expect(data[:updated_at]).to eq(group_member.updated_at&.xmlschema)
expect(data[:expires_at]).to eq(group_member.expires_at&.xmlschema)
end
end
......
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