From 49b36d0670a925710ee2f4d71ea5594bd1aaf144 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 24 Oct 2013 15:10:25 +1100 Subject: [PATCH] Delete enterprise group --- app/views/admin/enterprise_groups/index.html.haml | 1 + spec/features/admin/enterprise_groups_spec.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/app/views/admin/enterprise_groups/index.html.haml b/app/views/admin/enterprise_groups/index.html.haml index af39cf9ca6..b01dd7b017 100644 --- a/app/views/admin/enterprise_groups/index.html.haml +++ b/app/views/admin/enterprise_groups/index.html.haml @@ -22,3 +22,4 @@ %td= enterprise_group.enterprises.map(&:name).join ', ' %td.actions = link_to '', main_app.edit_admin_enterprise_group_path(enterprise_group), class: 'edit-enterprise-group icon-edit no-text' + = link_to_delete enterprise_group, no_text: true diff --git a/spec/features/admin/enterprise_groups_spec.rb b/spec/features/admin/enterprise_groups_spec.rb index c78f4d4ee8..75decd0c2a 100644 --- a/spec/features/admin/enterprise_groups_spec.rb +++ b/spec/features/admin/enterprise_groups_spec.rb @@ -73,6 +73,18 @@ feature %q{ eg.enterprises.should == [e2] end + scenario "deleting an enterprise group", js: true do + eg = create(:enterprise_group, name: 'EGEGEG') + + click_link 'Configuration' + click_link 'Enterprise Groups' + first("a.delete-resource").click + + page.should have_no_content 'EGEGEG' + + EnterpriseGroup.all.should_not include eg + end + context "as an enterprise user" do xit "should show me only enterprises I manage when creating a new enterprise group"