Move another group member spec from spinach

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2017-06-26 17:00:07 +02:00
parent 69043814b4
commit 0aa5f08988
No known key found for this signature in database
GPG key ID: 627C5F589F467F17
2 changed files with 17 additions and 7 deletions

View file

@ -4,13 +4,6 @@ Feature: Group Members
And "John Doe" is owner of group "Owned" And "John Doe" is owner of group "Owned"
And "John Doe" is guest of group "Guest" And "John Doe" is guest of group "Guest"
Scenario: Guest should not be able to remove other users from group
Given "Mary Jane" is guest of group "Guest"
When I visit group "Guest" members page
Then I should see user "John Doe" in team list
Then I should see user "Mary Jane" in team list
Then I should not see the "Remove User From Group" button for "Mary Jane"
Scenario: Search member by name Scenario: Search member by name
Given "Mary Jane" is guest of group "Guest" Given "Mary Jane" is guest of group "Guest"
And I visit group "Guest" members page And I visit group "Guest" members page

View file

@ -77,6 +77,23 @@ feature 'Groups > Members > Manage members', feature: true do
end end
end end
scenario 'guest can not manage other users' do
group.add_guest(user1)
group.add_developer(user2)
visit group_group_members_path(group)
expect(page).not_to have_button 'Add to group'
page.within(second_row) do
# Can not modify user2 role
expect(page).not_to have_button 'Developer'
# Can not remove user2
expect(page).not_to have_css('a.btn-remove')
end
end
def first_row def first_row
page.all('ul.content-list > li')[0] page.all('ul.content-list > li')[0]
end end