def edit
projects
- @avaliable_projects = current_user.admin? ? Project.without_team(user_team) : current_user.owned_projects.without_team(user_team)
+ @avaliable_projects = current_user.owned_projects.without_team(user_team)
end
def update
= select_tag :project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span2"}
%hr
= submit_tag 'Add user to projects in group', class: "btn btn-create"
+ .ui-box
+ %h5.title
+ Users from Group projects
+ %small
+ (#{@group.users.count})
+ %ul.well-list
+ - @group.users.sort_by(&:name).each do |user|
+ %li{class: dom_class(user)}
+ %strong
+ = link_to user.name, admin_user_path(user)
+ %span.pull-right.light
+ = pluralize user.authorized_projects.in_namespace(@group).count, 'project'
.span6
.ui-box
%small
(#{@group.projects.count})
%ul.well-list
- - @group.projects.each do |project|
+ - @group.projects.sort_by(&:name).each do |project|
%li
%strong
= link_to project.name_with_namespace, [:admin, project]
Then I should be redirected to group page
And I should see newly created group
+ @javascript
Scenario: Add user into projects in group
When I visit admin group page
When I select user "John" from user list as "Reporter"
include SharedAuthentication
include SharedPaths
include SharedActiveTab
+ include Select2Helper
When 'I visit admin group page' do
visit admin_group_path(current_group)
When 'I select user "John" from user list as "Reporter"' do
user = User.find_by_name("John")
+ select2(user.id, from: "#user_ids", multiple: true)
within "#new_team_member" do
- select user.name, from: "user_ids"
select "Reporter", from: "project_access"
end
click_button "Add user to projects in group"
Then 'I should see "John" in team list in every project as "Reporter"' do
user = User.find_by_name("John")
- projects_with_access = find(".user_#{user.id} .projects_access")
- projects_with_access.should have_link("Reporter")
end
protected