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

Fixed removing groups

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