2020-12-04 19:10:01 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require "spec_helper"
|
|
|
|
|
|
|
|
RSpec.describe Admin::UserEntity do
|
|
|
|
let_it_be(:user) { build_stubbed(:user) }
|
2021-04-14 11:09:04 -04:00
|
|
|
|
2020-12-04 19:10:01 -05:00
|
|
|
let(:request) { double('request') }
|
|
|
|
|
|
|
|
let(:entity) do
|
|
|
|
described_class.new(user, request: request)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#as_json' do
|
|
|
|
subject { entity.as_json&.keys }
|
|
|
|
|
|
|
|
it 'exposes correct attributes' do
|
2021-04-13 20:10:39 -04:00
|
|
|
is_expected.to include(
|
2020-12-04 19:10:01 -05:00
|
|
|
:id,
|
|
|
|
:name,
|
|
|
|
:created_at,
|
|
|
|
:email,
|
|
|
|
:username,
|
|
|
|
:last_activity_on,
|
|
|
|
:avatar_url,
|
2021-02-01 16:09:15 -05:00
|
|
|
:note,
|
2020-12-04 19:10:01 -05:00
|
|
|
:badges,
|
|
|
|
:projects_count,
|
|
|
|
:actions
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|