Commit b7e2be24 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix adding new members to group

parent 3371e40b
= form_for @group_member, url: group_group_members_path(@group), html: { class: 'form-horizontal users-group-form' } do |f| = form_for @group_member, url: group_group_members_path(@group), html: { class: 'form-horizontal users-group-form' } do |f|
.form-group .form-group
= f.label :user_ids, "People", class: 'control-label' = f.label :user_ids, "People", class: 'control-label'
.col-sm-10= users_select_tag(:user_ids, multiple: true, class: 'input-large') .col-sm-10= users_select_tag(:user_ids, multiple: true, class: 'input-large', scope: :all)
.form-group .form-group
= f.label :access_level, "Group Access", class: 'control-label' = f.label :access_level, "Group Access", class: 'control-label'
......
...@@ -47,6 +47,14 @@ Feature: Groups ...@@ -47,6 +47,14 @@ Feature: Groups
Then I should not see group "Owned" avatar Then I should not see group "Owned" avatar
And I should not see the "Remove avatar" button 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 # Leave
@javascript @javascript
......
...@@ -5,6 +5,32 @@ class Spinach::Features::Groups < Spinach::FeatureSteps ...@@ -5,6 +5,32 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
include SharedUser include SharedUser
include Select2Helper 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 step 'I should see group "Owned" projects list' do
Group.find_by(name: "Owned").projects.each do |project| Group.find_by(name: "Owned").projects.each do |project|
page.should have_link project.name page.should have_link project.name
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment