Commit 72946f6b authored by Ash McKenzie's avatar Ash McKenzie

Merge branch 'vij-add-last-activity' into 'master'

Add last_activity_on to BillableMember entity

See merge request gitlab-org/gitlab!52666
parents 48788a9f 89b38e1e
......@@ -284,6 +284,7 @@ Example response:
"state": "active",
"avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon",
"web_url": "http://192.168.1.8:3000/root",
"last_activity_on": "2021-01-27"
},
{
"id": 2,
......@@ -292,7 +293,8 @@ Example response:
"state": "active",
"avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon",
"web_url": "http://192.168.1.8:3000/root",
"email": "john@example.com"
"email": "john@example.com",
"last_activity_on": "2021-01-25"
},
{
"id": 3,
......@@ -300,7 +302,8 @@ Example response:
"name": "Foo bar",
"state": "active",
"avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon",
"web_url": "http://192.168.1.8:3000/root"
"web_url": "http://192.168.1.8:3000/root",
"last_activity_on": "2021-01-20"
}
]
```
......
---
title: Add last_activity_on attribute to Billable Members API
merge_request: 52666
author:
type: changed
......@@ -5,6 +5,7 @@ module EE
module Entities
class BillableMember < ::API::Entities::UserBasic
expose :public_email, as: :email
expose :last_activity_on
end
end
end
......
......@@ -3,10 +3,16 @@
require 'spec_helper'
RSpec.describe ::EE::API::Entities::BillableMember do
let(:member) { build(:user, public_email: public_email, email: 'private@email.com') }
let(:last_activity_on) { Date.today }
let(:public_email) { nil }
let(:member) { build(:user, public_email: public_email, email: 'private@email.com', last_activity_on: last_activity_on) }
subject(:entity_representation) { described_class.new(member).as_json }
it 'returns the last_activity_on attribute' do
expect(entity_representation[:last_activity_on]).to eq last_activity_on
end
context 'when the user has a public_email assigned' do
let(:public_email) { 'public@email.com' }
......
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