diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-31 00:17:49 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-31 00:17:49 +0300 |
commit | b7e2be247f3414ec5635db382358a6c3a3ddf089 (patch) | |
tree | b19a2e9ee1e02418f207b209e2e83fdeab0750b0 /features | |
parent | 3371e40bd40ad91f476af52c8d89f022c9895784 (diff) |
Fix adding new members to group
Diffstat (limited to 'features')
-rw-r--r-- | features/groups.feature | 8 | ||||
-rw-r--r-- | features/steps/groups.rb | 26 |
2 files changed, 34 insertions, 0 deletions
diff --git a/features/groups.feature b/features/groups.feature index 05546e0d6ef..65d06a0daf9 100644 --- a/features/groups.feature +++ b/features/groups.feature @@ -47,6 +47,14 @@ Feature: Groups Then I should not see group "Owned" avatar And I should not see the "Remove avatar" button + @javascript + Scenario: Add user to group + 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 "Reporter" + # Leave @javascript diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 91921f5e21c..ec5213e4b93 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -5,6 +5,32 @@ class Spinach::Features::Groups < Spinach::FeatureSteps include SharedUser include Select2Helper + step 'gitlab user "Mike"' do + create(:user, name: "Mike") + end + + step 'I click link "Add members"' do + find(:css, 'button.btn-new').click + end + + step 'I select "Mike" as "Reporter"' do + user = User.find_by(name: "Mike") + + within ".users-group-form" do + select2(user.id, from: "#user_ids", multiple: true) + select "Reporter", from: "access_level" + end + + click_button "Add users to group" + end + + step 'I should see "Mike" in team list as "Reporter"' do + within '.well-list' do + page.should have_content('Mike') + page.should have_content('Reporter') + end + end + step 'I should see group "Owned" projects list' do Group.find_by(name: "Owned").projects.each do |project| page.should have_link project.name |