diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-28 18:09:27 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-28 18:09:27 +0000 |
commit | e1b9b92a49eea88ea7c3b101aec0315e64e94678 (patch) | |
tree | fadb5aa290045f6b345ad51b4752515d5a126dd7 /spec/serializers/merge_request_user_entity_spec.rb | |
parent | c6ee7ef0f577e0155740d022babdc1b2b0e28d87 (diff) | |
download | gitlab-ce-e1b9b92a49eea88ea7c3b101aec0315e64e94678.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers/merge_request_user_entity_spec.rb')
-rw-r--r-- | spec/serializers/merge_request_user_entity_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/serializers/merge_request_user_entity_spec.rb b/spec/serializers/merge_request_user_entity_spec.rb index a2ad8e72845..dcd4ef6acfb 100644 --- a/spec/serializers/merge_request_user_entity_spec.rb +++ b/spec/serializers/merge_request_user_entity_spec.rb @@ -17,5 +17,23 @@ RSpec.describe MergeRequestUserEntity do it 'exposes needed attributes' do expect(subject).to include(:id, :name, :username, :state, :avatar_url, :web_url, :can_merge) end + + context 'when `status` is not preloaded' do + it 'does not expose the availability attribute' do + expect(subject).not_to include(:availability) + end + end + + context 'when `status` is preloaded' do + before do + user.create_status!(availability: :busy) + + user.status # make sure `status` is loaded + end + + it 'exposes the availibility attribute' do + expect(subject[:availability]).to eq('busy') + end + end end end |