summaryrefslogtreecommitdiff
path: root/spec/features/groups
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-02-08 17:02:25 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-02-10 17:34:12 +0200
commit5f85487c1526f2921f1cef30aceb2fddf84d3632 (patch)
treefd2eeccef302f6ec04f85d1620cdfc8e4edf3c5e /spec/features/groups
parent059d1ae4c847aa9018c89900b39c2782aa9b623e (diff)
downloadgitlab-ce-5f85487c1526f2921f1cef30aceb2fddf84d3632.tar.gz
Show parent group members for nested groupdz-nested-groups-members-page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/features/groups')
-rw-r--r--spec/features/groups/members/list_spec.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/features/groups/members/list_spec.rb b/spec/features/groups/members/list_spec.rb
new file mode 100644
index 00000000000..109de39b2dd
--- /dev/null
+++ b/spec/features/groups/members/list_spec.rb
@@ -0,0 +1,40 @@
+require 'spec_helper'
+
+feature 'Groups members list', feature: true do
+ let(:user1) { create(:user, name: 'John Doe') }
+ let(:user2) { create(:user, name: 'Mary Jane') }
+ let(:group) { create(:group) }
+ let(:nested_group) { create(:group, parent: group) }
+
+ background do
+ login_as(user1)
+ end
+
+ scenario 'show members from current group and parent' do
+ group.add_developer(user1)
+ nested_group.add_developer(user2)
+
+ visit group_group_members_path(nested_group)
+
+ expect(first_row.text).to include(user1.name)
+ expect(second_row.text).to include(user2.name)
+ end
+
+ scenario 'show user once if member of both current group and parent' do
+ group.add_developer(user1)
+ nested_group.add_developer(user1)
+
+ visit group_group_members_path(nested_group)
+
+ expect(first_row.text).to include(user1.name)
+ expect(second_row).to be_blank
+ end
+
+ def first_row
+ page.all('ul.content-list > li')[0]
+ end
+
+ def second_row
+ page.all('ul.content-list > li')[1]
+ end
+end