Commit 73c4da17 authored by Phil Hughes's avatar Phil Hughes

Fixed removing groups

parent 11c0c650
...@@ -29,8 +29,13 @@ class Projects::GroupLinksController < Projects::ApplicationController ...@@ -29,8 +29,13 @@ class Projects::GroupLinksController < Projects::ApplicationController
def destroy def destroy
project.project_group_links.find(params[:id]).destroy project.project_group_links.find(params[:id]).destroy
respond_to do |format|
format.html do
redirect_to namespace_project_group_links_path(project.namespace, project) redirect_to namespace_project_group_links_path(project.namespace, project)
end end
format.js { head :ok }
end
end
protected protected
......
- group = local_assigns[:group] - group = local_assigns[:group]
- group_link = local_assigns[:group_link] - group_link = local_assigns[:group_link]
%li.member{ class: dom_class(group), id: dom_id(group) } %li.member.group_member{ id: "group_member_#{group_link.id}" }
%span{ class: "list-item-name" } %span{ class: "list-item-name" }
= image_tag group_icon(group), class: "avatar s40", alt: '' = image_tag group_icon(group), class: "avatar s40", alt: ''
%strong %strong
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
= link_to namespace_project_group_link_path(@project.namespace, @project, group_link), = link_to namespace_project_group_link_path(@project.namespace, @project, group_link),
remote: true, remote: true,
method: :delete, method: :delete,
data: { confirm: "Are you sure you want to remove #{group.name}?" },
class: 'btn btn-remove prepend-left-10' do class: 'btn btn-remove prepend-left-10' do
%span.visible-xs-block %span.visible-xs-block
Delete Delete
......
...@@ -34,4 +34,13 @@ feature 'Projects > Members > Anonymous user sees members', feature: true, js: t ...@@ -34,4 +34,13 @@ feature 'Projects > Members > Anonymous user sees members', feature: true, js: t
expect(page).to have_content('Expires in') expect(page).to have_content('Expires in')
end end
end end
it 'deletes group link' do
page.within(first('.group_member')) do
find('.btn-remove').click
end
wait_for_ajax
expect(page).not_to have_selector('.group_member')
end
end end
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