diff options
author | Rémy Coutable <remy@rymai.me> | 2018-03-29 12:47:54 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-04-23 13:20:30 +0300 |
commit | 023d4f6f2f3d88d0966fe01e6ef921fd03a309fe (patch) | |
tree | 6aabb650fe2ba200222c57f1a4ac66ff0a9143e8 /spec/support/shared_examples/group_members_shared_example.rb | |
parent | eb1cb7bed6951bdda54abd55e86fd793e6954a56 (diff) |
Move spec helpers/matchers/shared examples/contexts to their relevant folder
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/support/shared_examples/group_members_shared_example.rb')
-rw-r--r-- | spec/support/shared_examples/group_members_shared_example.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/support/shared_examples/group_members_shared_example.rb b/spec/support/shared_examples/group_members_shared_example.rb new file mode 100644 index 00000000000..547c83c7955 --- /dev/null +++ b/spec/support/shared_examples/group_members_shared_example.rb @@ -0,0 +1,27 @@ +RSpec.shared_examples 'members and requesters associations' do + describe '#members_and_requesters' do + it 'includes members and requesters' do + member_and_requester_user_ids = namespace.members_and_requesters.pluck(:user_id) + + expect(member_and_requester_user_ids).to include(requester.id, developer.id) + end + end + + describe '#members' do + it 'includes members and exclude requesters' do + member_user_ids = namespace.members.pluck(:user_id) + + expect(member_user_ids).to include(developer.id) + expect(member_user_ids).not_to include(requester.id) + end + end + + describe '#requesters' do + it 'does not include requesters' do + requester_user_ids = namespace.requesters.pluck(:user_id) + + expect(requester_user_ids).to include(requester.id) + expect(requester_user_ids).not_to include(developer.id) + end + end +end |