summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/admin/admin_hooks_spec.rb12
-rw-r--r--spec/features/projects/members/user_requests_access_spec.rb2
-rw-r--r--spec/features/u2f_spec.rb10
3 files changed, 21 insertions, 3 deletions
diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb
index 25ed3bdc88e..370077771d0 100644
--- a/spec/features/admin/admin_hooks_spec.rb
+++ b/spec/features/admin/admin_hooks_spec.rb
@@ -81,14 +81,22 @@ describe 'Admin::Hooks' do
it 'from hooks list page' do
visit admin_hooks_path
- expect { accept_confirm { find(:link, 'Remove').send_keys(:return) } }.to change(SystemHook, :count).by(-1)
+ expect do
+ accept_confirm { find(:link, 'Remove').send_keys(:return) }
+
+ wait_for_requests
+ end.to change(SystemHook, :count).by(-1)
end
it 'from hook edit page' do
visit admin_hooks_path
click_link 'Edit'
- expect { accept_confirm { find(:link, 'Remove').send_keys(:return) } }.to change(SystemHook, :count).by(-1)
+ expect do
+ accept_confirm { find(:link, 'Remove').send_keys(:return) }
+
+ wait_for_requests
+ end.to change(SystemHook, :count).by(-1)
end
end
end
diff --git a/spec/features/projects/members/user_requests_access_spec.rb b/spec/features/projects/members/user_requests_access_spec.rb
index 50ba67f0ffc..d3b9002d92c 100644
--- a/spec/features/projects/members/user_requests_access_spec.rb
+++ b/spec/features/projects/members/user_requests_access_spec.rb
@@ -62,6 +62,8 @@ describe 'Projects > Members > User requests access', :js do
accept_confirm { click_link 'Withdraw Access Request' }
+ wait_for_requests
+
expect(project.requesters.exists?(user_id: user)).to be_falsey
expect(page).to have_content 'Your access request to the project has been withdrawn.'
end
diff --git a/spec/features/u2f_spec.rb b/spec/features/u2f_spec.rb
index ae9b65d1a39..2d31e2dca0f 100644
--- a/spec/features/u2f_spec.rb
+++ b/spec/features/u2f_spec.rb
@@ -75,7 +75,13 @@ describe 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
first_u2f_device = register_u2f_device
second_u2f_device = register_u2f_device(name: 'My other device')
- accept_confirm { click_on "Delete", match: :first }
+ accept_confirm do
+ within('table.u2f-registrations') do
+ find('tr', text: first_u2f_device.name).click_link('Delete')
+ end
+ end
+
+ wait_for_requests
expect(page).to have_content('Successfully deleted')
expect(page.body).not_to match(first_u2f_device.name)
@@ -263,6 +269,8 @@ describe 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
visit profile_two_factor_auth_path
expect do
accept_confirm { click_on "Disable" }
+
+ wait_for_requests
end.to change { U2fRegistration.count }.by(-1)
end
end