diff options
author | Robert Speicher <robert@gitlab.com> | 2015-11-17 18:23:27 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2015-11-17 18:23:27 +0000 |
commit | d431f3ec40e03ed4d65ef80bae2fb7a0558fd2d2 (patch) | |
tree | 15054a1db51a578e061735d3bb2e820000e727fd /features | |
parent | 5098ad9d3c892b2ba117950eac8770fcfad9e53b (diff) | |
parent | d60a23b718abc365651f146de678f20367ef25b1 (diff) | |
download | gitlab-ce-d431f3ec40e03ed4d65ef80bae2fb7a0558fd2d2.tar.gz |
Merge branch 'james11/gitlab-ce-removable-group-owner' into 'master'
Prevent the last owner of a group from being able to delete themselves
by 'adding' themselves as a master
Replaces !1708.
Fixes #1111.
See merge request !1815
Diffstat (limited to 'features')
-rw-r--r-- | features/groups.feature | 8 | ||||
-rw-r--r-- | features/steps/groups.rb | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/features/groups.feature b/features/groups.feature index 615eff6a330..abf3769a844 100644 --- a/features/groups.feature +++ b/features/groups.feature @@ -60,6 +60,14 @@ Feature: Groups Then I should see "Mike" in team list as "Reporter" @javascript + Scenario: Ignore add user to group when is already Owner + Given gitlab user "Mike" + When I visit group "Owned" members page + And I click link "Add members" + When I select "Mike" as "Reporter" + Then I should see "Mike" in team list as "Owner" + + @javascript Scenario: Invite user to group When I visit group "Owned" members page And I click link "Add members" diff --git a/features/steps/groups.rb b/features/steps/groups.rb index a8fba2406ae..9c0313537b1 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -48,6 +48,17 @@ class Spinach::Features::Groups < Spinach::FeatureSteps click_button "Add users to group" end + step 'I select "Mike" as "Master"' do + user = User.find_by(name: "Mike") + + page.within ".users-group-form" do + select2(user.id, from: "#user_ids", multiple: true) + select "Master", from: "access_level" + end + + click_button "Add users to group" + end + step 'I should see "Mike" in team list as "Reporter"' do page.within '.well-list' do expect(page).to have_content('Mike') @@ -55,6 +66,13 @@ class Spinach::Features::Groups < Spinach::FeatureSteps end end + step 'I should see "Mike" in team list as "Owner"' do + page.within '.well-list' do + expect(page).to have_content('Mike') + expect(page).to have_content('Owner') + end + end + step 'I select "sjobs@apple.com" as "Reporter"' do page.within ".users-group-form" do select2("sjobs@apple.com", from: "#user_ids", multiple: true) |