diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
commit | be834a25982746ffd85252ff502df42bb88cb9d5 (patch) | |
tree | b4d6a8ba0931e12fac08f05abea33a3b8ec2c8a2 /spec/helpers/groups/group_members_helper_spec.rb | |
parent | ee925a3597f27e92f83a50937a64068109675b3d (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc32
Diffstat (limited to 'spec/helpers/groups/group_members_helper_spec.rb')
-rw-r--r-- | spec/helpers/groups/group_members_helper_spec.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/helpers/groups/group_members_helper_spec.rb b/spec/helpers/groups/group_members_helper_spec.rb index a25bf1c4157..abf621aee10 100644 --- a/spec/helpers/groups/group_members_helper_spec.rb +++ b/spec/helpers/groups/group_members_helper_spec.rb @@ -5,6 +5,8 @@ require "spec_helper" RSpec.describe Groups::GroupMembersHelper do include MembersPresentation + let_it_be(:current_user) { create(:user) } + describe '.group_member_select_options' do let(:group) { create(:group) } @@ -20,6 +22,10 @@ RSpec.describe Groups::GroupMembersHelper do describe '#linked_groups_data_json' do include_context 'group_group_link' + before do + allow(helper).to receive(:current_user).and_return(current_user) + end + it 'matches json schema' do json = helper.linked_groups_data_json(shared_group.shared_with_group_links) @@ -28,7 +34,6 @@ RSpec.describe Groups::GroupMembersHelper do end describe '#members_data_json' do - let(:current_user) { create(:user) } let(:group) { create(:group) } before do @@ -48,6 +53,14 @@ RSpec.describe Groups::GroupMembersHelper do let(:group_member) { create(:group_member, group: group, created_by: current_user) } it_behaves_like 'group_members.json' + + context 'with user status set' do + let(:user) { create(:user) } + let!(:status) { create(:user_status, user: user) } + let(:group_member) { create(:group_member, group: group, user: user, created_by: current_user) } + + it_behaves_like 'group_members.json' + end end context 'for an invited group member' do |