diff options
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/admin/admin_hooks_spec.rb | 10 | ||||
-rw-r--r-- | spec/features/projects/members/user_requests_access_spec.rb | 3 | ||||
-rw-r--r-- | spec/features/u2f_spec.rb | 20 |
3 files changed, 9 insertions, 24 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 |