summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/features/admin/admin_hooks_spec.rb10
-rw-r--r--spec/features/projects/members/user_requests_access_spec.rb3
-rw-r--r--spec/features/u2f_spec.rb20
-rw-r--r--spec/support/shared_examples/features/master_manages_access_requests_shared_example.rb4
4 files changed, 10 insertions, 27 deletions
diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb
index 25ed3bdc88e..ce780789f5a 100644
--- a/spec/features/admin/admin_hooks_spec.rb
+++ b/spec/features/admin/admin_hooks_spec.rb
@@ -73,22 +73,26 @@ describe 'Admin::Hooks' do
end
describe 'Remove existing hook', :js do
+ let(:hook_url) { generate(:url) }
+
before do
- create(:system_hook)
+ create(:system_hook, url: hook_url)
end
context 'removes existing hook' 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)
+ accept_confirm { click_link 'Remove' }
+ expect(page).not_to have_content(hook_url)
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)
+ accept_confirm { click_link 'Remove' }
+ expect(page).not_to have_content(hook_url)
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..f26941ab567 100644
--- a/spec/features/projects/members/user_requests_access_spec.rb
+++ b/spec/features/projects/members/user_requests_access_spec.rb
@@ -62,8 +62,9 @@ describe 'Projects > Members > User requests access', :js do
accept_confirm { click_link 'Withdraw Access Request' }
- expect(project.requesters.exists?(user_id: user)).to be_falsey
expect(page).to have_content 'Your access request to the project has been withdrawn.'
+ expect(page).not_to have_content 'Withdraw Access Request'
+ expect(page).to have_content 'Request Access'
end
def open_project_settings_menu
diff --git a/spec/features/u2f_spec.rb b/spec/features/u2f_spec.rb
index ae9b65d1a39..ea02f36d9d0 100644
--- a/spec/features/u2f_spec.rb
+++ b/spec/features/u2f_spec.rb
@@ -246,26 +246,6 @@ describe 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
end
end
end
-
- describe "when two-factor authentication is disabled" do
- let(:user) { create(:user) }
-
- before do
- user = gitlab_sign_in(:user)
- user.update_attribute(:otp_required_for_login, true)
- visit profile_account_path
- manage_two_factor_authentication
- expect(page).to have_content("Your U2F device needs to be set up.")
- register_u2f_device
- end
-
- it "deletes u2f registrations" do
- visit profile_two_factor_auth_path
- expect do
- accept_confirm { click_on "Disable" }
- end.to change { U2fRegistration.count }.by(-1)
- end
- end
end
describe 'fallback code authentication' do
diff --git a/spec/support/shared_examples/features/master_manages_access_requests_shared_example.rb b/spec/support/shared_examples/features/master_manages_access_requests_shared_example.rb
index 75ad948e42c..d87e5fcaa88 100644
--- a/spec/support/shared_examples/features/master_manages_access_requests_shared_example.rb
+++ b/spec/support/shared_examples/features/master_manages_access_requests_shared_example.rb
@@ -19,7 +19,7 @@ RSpec.shared_examples 'Maintainer manages access requests' do
expect_visible_access_request(entity, user)
- accept_confirm { click_on 'Grant access' }
+ click_on 'Grant access'
expect_no_visible_access_request(entity, user)
@@ -40,13 +40,11 @@ RSpec.shared_examples 'Maintainer manages access requests' do
end
def expect_visible_access_request(entity, user)
- expect(entity.requesters.exists?(user_id: user)).to be_truthy
expect(page).to have_content "Users requesting access to #{entity.name} 1"
expect(page).to have_content user.name
end
def expect_no_visible_access_request(entity, user)
- expect(entity.requesters.exists?(user_id: user)).to be_falsy
expect(page).not_to have_content "Users requesting access to #{entity.name}"
end
end