summaryrefslogtreecommitdiff
path: root/spec/features/groups_spec.rb
diff options
context:
space:
mode:
authorDiego Souza <diegosouza.br@gmail.com>2017-07-04 15:18:51 +0000
committerRémy Coutable <remy@rymai.me>2017-07-04 15:18:51 +0000
commit2210a71b17d41ca0f1b5b4e619aa7fa8f41ad5cd (patch)
treec76b9979126dbaa297dcb079dfb46a0d79683b6d /spec/features/groups_spec.rb
parent016b9f2565f85b9c77a5a779b64483ca1d4e1776 (diff)
downloadgitlab-ce-2210a71b17d41ca0f1b5b4e619aa7fa8f41ad5cd.tar.gz
Remove group modal like remove project modal. Closes #33130
Diffstat (limited to 'spec/features/groups_spec.rb')
-rw-r--r--spec/features/groups_spec.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb
index ecacca00a61..c1dc7be7088 100644
--- a/spec/features/groups_spec.rb
+++ b/spec/features/groups_spec.rb
@@ -135,7 +135,7 @@ feature 'Group', feature: true do
expect(page).not_to have_content('secret-group')
end
- describe 'group edit' do
+ describe 'group edit', js: true do
let(:group) { create(:group) }
let(:path) { edit_group_path(group) }
let(:new_name) { 'new-name' }
@@ -157,8 +157,8 @@ feature 'Group', feature: true do
end
it 'removes group' do
- click_link 'Remove group'
-
+ expect { remove_with_confirm('Remove group', group.path) }.to change {Group.count}.by(-1)
+ expect(group.members.all.count).to be_zero
expect(page).to have_content "scheduled for deletion"
end
end
@@ -212,4 +212,10 @@ feature 'Group', feature: true do
expect(page).to have_content(nested_group.name)
end
end
+
+ def remove_with_confirm(button_text, confirm_with)
+ click_button button_text
+ fill_in 'confirm_name_input', with: confirm_with
+ click_button 'Confirm'
+ end
end