diff --git a/spec/features/abuse_report_spec.rb b/spec/features/abuse_report_spec.rb index b88e801c3d741c3506d73368e85b7f9ad1aa76e6..f26d3a6a72f7aa1130e5d5db55a374b9eb749764 100644 --- a/spec/features/abuse_report_spec.rb +++ b/spec/features/abuse_report_spec.rb @@ -4,7 +4,7 @@ feature 'Abuse reports', feature: true do let(:another_user) { create(:user) } before do - gitlab_sign_in :user + sign_in(create(:user)) end scenario 'Report abuse' do diff --git a/spec/features/admin/admin_abuse_reports_spec.rb b/spec/features/admin/admin_abuse_reports_spec.rb index 3a6e356b0b07a288a99fb4be5373694727c6feb9..8672c009f90c7fc8356cc6f059a7b18cb8c3f2bb 100644 --- a/spec/features/admin/admin_abuse_reports_spec.rb +++ b/spec/features/admin/admin_abuse_reports_spec.rb @@ -5,7 +5,7 @@ describe "Admin::AbuseReports", feature: true, js: true do context 'as an admin' do before do - gitlab_sign_in :admin + sign_in(create(:admin)) end describe 'if a user has been reported for abuse' do diff --git a/spec/features/admin/admin_active_tab_spec.rb b/spec/features/admin/admin_active_tab_spec.rb index c74336d8221203da8b2550b6e839c72a7ce3863d..07430ecd6e02f860b13b07189f74822e3b8e83a9 100644 --- a/spec/features/admin/admin_active_tab_spec.rb +++ b/spec/features/admin/admin_active_tab_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' RSpec.describe 'admin active tab' do before do - gitlab_sign_in :admin + sign_in(create(:admin)) end shared_examples 'page has active tab' do |title| diff --git a/spec/features/admin/admin_appearance_spec.rb b/spec/features/admin/admin_appearance_spec.rb index d8fd4319328e9999d80756b8d7f926ea4e0dceff..1e2cb8569ec1a57b6cd6e2b53e1c136e71f2680c 100644 --- a/spec/features/admin/admin_appearance_spec.rb +++ b/spec/features/admin/admin_appearance_spec.rb @@ -4,7 +4,7 @@ feature 'Admin Appearance', feature: true do let!(:appearance) { create(:appearance) } scenario 'Create new appearance' do - gitlab_sign_in :admin + sign_in(create(:admin)) visit admin_appearances_path fill_in 'appearance_title', with: 'MyCompany' @@ -20,7 +20,7 @@ feature 'Admin Appearance', feature: true do end scenario 'Preview appearance' do - gitlab_sign_in :admin + sign_in(create(:admin)) visit admin_appearances_path click_link "Preview" @@ -34,7 +34,7 @@ feature 'Admin Appearance', feature: true do end scenario 'Appearance logo' do - gitlab_sign_in :admin + sign_in(create(:admin)) visit admin_appearances_path attach_file(:appearance_logo, logo_fixture) @@ -46,7 +46,7 @@ feature 'Admin Appearance', feature: true do end scenario 'Header logos' do - gitlab_sign_in :admin + sign_in(create(:admin)) visit admin_appearances_path attach_file(:appearance_header_logo, logo_fixture) diff --git a/spec/features/admin/admin_broadcast_messages_spec.rb b/spec/features/admin/admin_broadcast_messages_spec.rb index da063bf7b744542336caaf903fbe326d4940a4a2..e55308e393b089e7e454620340c43ada6ff6de7c 100644 --- a/spec/features/admin/admin_broadcast_messages_spec.rb +++ b/spec/features/admin/admin_broadcast_messages_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Admin Broadcast Messages', feature: true do before do - gitlab_sign_in :admin + sign_in(create(:admin)) create(:broadcast_message, :expired, message: 'Migration to new server') visit admin_broadcast_messages_path end diff --git a/spec/features/admin/admin_browse_spam_logs_spec.rb b/spec/features/admin/admin_browse_spam_logs_spec.rb index d9c4fc686b138687ac347ea107125b3376c78996..31d4142a8e904c1893f47d44d817dd2138fb3380 100644 --- a/spec/features/admin/admin_browse_spam_logs_spec.rb +++ b/spec/features/admin/admin_browse_spam_logs_spec.rb @@ -4,7 +4,7 @@ describe 'Admin browse spam logs' do let!(:spam_log) { create(:spam_log, description: 'abcde ' * 20) } before do - gitlab_sign_in :admin + sign_in(create(:admin)) end scenario 'Browse spam logs' do diff --git a/spec/features/admin/admin_browses_logs_spec.rb b/spec/features/admin/admin_browses_logs_spec.rb index c734a2ef16daef47ec20001b0a8560c0e64c468d..3e3404dfdac2003727cdc4f003038c8bec1b335c 100644 --- a/spec/features/admin/admin_browses_logs_spec.rb +++ b/spec/features/admin/admin_browses_logs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Admin browses logs' do before do - gitlab_sign_in :admin + sign_in(create(:admin)) end it 'shows available log files' do diff --git a/spec/features/admin/admin_builds_spec.rb b/spec/features/admin/admin_builds_spec.rb index e767081f3e58d91099607b41a1719c22214d3977..e020579f71e403a2bdda1018263d775ce802ae2b 100644 --- a/spec/features/admin/admin_builds_spec.rb +++ b/spec/features/admin/admin_builds_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Admin Builds' do before do - gitlab_sign_in :admin + sign_in(create(:admin)) end describe 'GET /admin/builds' do diff --git a/spec/features/admin/admin_cohorts_spec.rb b/spec/features/admin/admin_cohorts_spec.rb index 952e5475213a9ec578e7ea8a888de847bcfa7678..6840456e509b303e58a8d9f7319212d9fe89704a 100644 --- a/spec/features/admin/admin_cohorts_spec.rb +++ b/spec/features/admin/admin_cohorts_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' feature 'Admin cohorts page', feature: true do before do - gitlab_sign_in :admin + sign_in(create(:admin)) end scenario 'See users count per month' do diff --git a/spec/features/admin/admin_conversational_development_index_spec.rb b/spec/features/admin/admin_conversational_development_index_spec.rb index b484677a6dfb48f2f78f4d3bc75a949a7948c17f..2d2c7df53645f63b01e90bd66cdc93f3cb69dcd3 100644 --- a/spec/features/admin/admin_conversational_development_index_spec.rb +++ b/spec/features/admin/admin_conversational_development_index_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Admin Conversational Development Index' do before do - gitlab_sign_in :admin + sign_in(create(:admin)) end context 'when usage ping is disabled' do diff --git a/spec/features/admin/admin_deploy_keys_spec.rb b/spec/features/admin/admin_deploy_keys_spec.rb index 81cddd03f80bf72a45daa7fb587b2af33b411233..aaeaaa829e1e16901b28a70eec81f05c083aa338 100644 --- a/spec/features/admin/admin_deploy_keys_spec.rb +++ b/spec/features/admin/admin_deploy_keys_spec.rb @@ -5,7 +5,7 @@ RSpec.describe 'admin deploy keys', type: :feature do let!(:another_deploy_key) { create(:another_deploy_key, public: true) } before do - gitlab_sign_in(:admin) + sign_in(create(:admin)) end it 'show all public deploy keys' do diff --git a/spec/features/admin/admin_disables_git_access_protocol_spec.rb b/spec/features/admin/admin_disables_git_access_protocol_spec.rb index 063d54270bdcda8c1550e830e48e78414871a462..e2280b6e3b1d231b51a1d0b674018ab533c67c08 100644 --- a/spec/features/admin/admin_disables_git_access_protocol_spec.rb +++ b/spec/features/admin/admin_disables_git_access_protocol_spec.rb @@ -8,7 +8,7 @@ feature 'Admin disables Git access protocol', feature: true do background do stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') - gitlab_sign_in(admin) + sign_in(admin) end context 'with HTTP disabled' do diff --git a/spec/features/admin/admin_disables_two_factor_spec.rb b/spec/features/admin/admin_disables_two_factor_spec.rb index 5437da299797cd2f565a4c857b7cdb903ae10f1b..15dc6b6c234653463af258b89b078cbb80577f2b 100644 --- a/spec/features/admin/admin_disables_two_factor_spec.rb +++ b/spec/features/admin/admin_disables_two_factor_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' feature 'Admin disables 2FA for a user', feature: true do scenario 'successfully', js: true do - gitlab_sign_in(:admin) + sign_in(create(:admin)) user = create(:user, :two_factor) edit_user(user) @@ -17,7 +17,7 @@ feature 'Admin disables 2FA for a user', feature: true do end scenario 'for a user without 2FA enabled' do - gitlab_sign_in(:admin) + sign_in(create(:admin)) user = create(:user) edit_user(user) diff --git a/spec/features/admin/admin_groups_spec.rb b/spec/features/admin/admin_groups_spec.rb index 8b0fafc5f07003960ac5b78a5fb8a025bfd0258d..d15d998288482e768c9ab87a2ff82fad83fdfc48 100644 --- a/spec/features/admin/admin_groups_spec.rb +++ b/spec/features/admin/admin_groups_spec.rb @@ -6,9 +6,10 @@ feature 'Admin Groups', feature: true do let(:internal) { Gitlab::VisibilityLevel::INTERNAL } let(:user) { create :user } let!(:group) { create :group } - let!(:current_user) { gitlab_sign_in :admin } + let!(:current_user) { create(:admin) } before do + sign_in(current_user) stub_application_setting(default_group_visibility: internal) end diff --git a/spec/features/admin/admin_health_check_spec.rb b/spec/features/admin/admin_health_check_spec.rb index 75093aa4167c8bffee6875283670dbedc0977162..c404e054dba202e90b3ba9b31b5798d12dd4072a 100644 --- a/spec/features/admin/admin_health_check_spec.rb +++ b/spec/features/admin/admin_health_check_spec.rb @@ -5,7 +5,7 @@ feature "Admin Health Check", feature: true do before do stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') - gitlab_sign_in :admin + sign_in(create(:admin)) end describe '#show' do diff --git a/spec/features/admin/admin_hook_logs_spec.rb b/spec/features/admin/admin_hook_logs_spec.rb index ec80c420c7938f7cee54647898d2d75ca7bab799..94dace7a1fdfd0e9f66312c39bc0d2e5d2b730d0 100644 --- a/spec/features/admin/admin_hook_logs_spec.rb +++ b/spec/features/admin/admin_hook_logs_spec.rb @@ -6,7 +6,7 @@ feature 'Admin::HookLogs', feature: true do let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') } before do - gitlab_sign_in :admin + sign_in(create(:admin)) end scenario 'show list of hook logs' do diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb index c07c21bd6a188f935887aad2422c31b1c28fe20c..1e675fc0ce7e8cb4a2e2da31a63fc3a6f289d773 100644 --- a/spec/features/admin/admin_hooks_spec.rb +++ b/spec/features/admin/admin_hooks_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'Admin::Hooks', feature: true do before do @project = create(:project) - gitlab_sign_in :admin + sign_in(create(:admin)) @system_hook = create(:system_hook) end diff --git a/spec/features/admin/admin_labels_spec.rb b/spec/features/admin/admin_labels_spec.rb index bb40918bd22ed23eeacaa106104d1134b46a2691..ae9b47299e666c4e4270b858afaf066c318abcc6 100644 --- a/spec/features/admin/admin_labels_spec.rb +++ b/spec/features/admin/admin_labels_spec.rb @@ -5,7 +5,7 @@ RSpec.describe 'admin issues labels' do let!(:feature_label) { Label.create(title: 'feature', template: true) } before do - gitlab_sign_in :admin + sign_in(create(:admin)) end describe 'list' do diff --git a/spec/features/admin/admin_manage_applications_spec.rb b/spec/features/admin/admin_manage_applications_spec.rb index ae41267e5fc0491d619c5505c5ad095137d5c221..2e04a82806f8f7ca3cdb4293d831cbd12b7caa16 100644 --- a/spec/features/admin/admin_manage_applications_spec.rb +++ b/spec/features/admin/admin_manage_applications_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' RSpec.describe 'admin manage applications', feature: true do before do - gitlab_sign_in :admin + sign_in(create(:admin)) end it do diff --git a/spec/features/admin/admin_projects_spec.rb b/spec/features/admin/admin_projects_spec.rb index c6488cea798e450ba0ef3ebb4c96872ab6e070d7..942cc60e5ddb3d6d0a0419e0d754e169fe6771d9 100644 --- a/spec/features/admin/admin_projects_spec.rb +++ b/spec/features/admin/admin_projects_spec.rb @@ -5,8 +5,10 @@ describe "Admin::Projects", feature: true do let(:user) { create :user } let!(:project) { create(:project) } - let!(:current_user) do - gitlab_sign_in :admin + let!(:current_user) { create(:admin) } + + before do + sign_in(current_user) end describe "GET /admin/projects" do diff --git a/spec/features/admin/admin_requests_profiles_spec.rb b/spec/features/admin/admin_requests_profiles_spec.rb index 2bfe401521be9d39a178cd362955ebdacc9e4694..bf0c21cd04ab812255184ec091ef8c8e587865a9 100644 --- a/spec/features/admin/admin_requests_profiles_spec.rb +++ b/spec/features/admin/admin_requests_profiles_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'Admin::RequestsProfilesController', feature: true do before do FileUtils.mkdir_p(Gitlab::RequestProfiler::PROFILES_DIR) - gitlab_sign_in(:admin) + sign_in(create(:admin)) end after do diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb index 6ad2d456b932747f1a21a8d57dec66d8601f096c..b06e7e5037c562e8ecbc83d1982c8a14d2eedabd 100644 --- a/spec/features/admin/admin_runners_spec.rb +++ b/spec/features/admin/admin_runners_spec.rb @@ -5,7 +5,7 @@ describe "Admin Runners" do before do stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') - gitlab_sign_in :admin + sign_in(create(:admin)) end describe "Runners page" do diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index 59a50ff9264afb8e633a7e2f2f658c0f3f6d11a5..a44fa0b86d58ceaae1ca615ffceeba2d00b528bf 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -5,7 +5,7 @@ feature 'Admin updates settings', feature: true do before do stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') - gitlab_sign_in :admin + sign_in(create(:admin)) visit admin_application_settings_path end diff --git a/spec/features/admin/admin_system_info_spec.rb b/spec/features/admin/admin_system_info_spec.rb index 4efc7f0eb4813ca4fc03504e898d88119eaa36fd..1fd1cda694a023c5fa2163b43e402edb0017838e 100644 --- a/spec/features/admin/admin_system_info_spec.rb +++ b/spec/features/admin/admin_system_info_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Admin System Info' do before do - gitlab_sign_in :admin + sign_in(create(:admin)) end describe 'GET /admin/system_info' do diff --git a/spec/features/admin/admin_users_impersonation_tokens_spec.rb b/spec/features/admin/admin_users_impersonation_tokens_spec.rb index 231c094c91d749542763dca2338dda902cbf8cb5..cd7040891e99e5a8d7f8dec0bda8b91ac1cf2e94 100644 --- a/spec/features/admin/admin_users_impersonation_tokens_spec.rb +++ b/spec/features/admin/admin_users_impersonation_tokens_spec.rb @@ -13,7 +13,7 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do end before do - gitlab_sign_in(admin) + sign_in(admin) end describe "token creation" do diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb index 6dbc697642fcbc6381e6c7c53b48396cf4d336fe..3bc8f8aed54415894d6e7846b97c5f32a0fe8134 100644 --- a/spec/features/admin/admin_users_spec.rb +++ b/spec/features/admin/admin_users_spec.rb @@ -5,7 +5,11 @@ describe "Admin::Users", feature: true do create(:omniauth_user, provider: 'twitter', extern_uid: '123456') end - let!(:current_user) { gitlab_sign_in :admin } + let!(:current_user) { create(:admin) } + + before do + sign_in(current_user) + end describe "GET /admin/users" do before do diff --git a/spec/features/admin/admin_uses_repository_checks_spec.rb b/spec/features/admin/admin_uses_repository_checks_spec.rb index 5be0e2b2f170cf074dc7d0736247b43872ca230a..113353862be7b7192c53fb7d496bfaa72b7f3049 100644 --- a/spec/features/admin/admin_uses_repository_checks_spec.rb +++ b/spec/features/admin/admin_uses_repository_checks_spec.rb @@ -5,7 +5,7 @@ feature 'Admin uses repository checks', feature: true do before do stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') - gitlab_sign_in :admin + sign_in(create(:admin)) end scenario 'to trigger a single check' do diff --git a/spec/features/atom/issues_spec.rb b/spec/features/atom/issues_spec.rb index f7d170a7bf6654b2cb2efe46aa0e4864348b0dd6..011fdce21d8881200229cbec551c417b56bbd2c6 100644 --- a/spec/features/atom/issues_spec.rb +++ b/spec/features/atom/issues_spec.rb @@ -15,7 +15,7 @@ describe 'Issues Feed', feature: true do context 'when authenticated' do it 'renders atom feed' do - gitlab_sign_in user + sign_in user visit project_issues_path(project, :atom) expect(response_headers['Content-Type']) diff --git a/spec/features/auto_deploy_spec.rb b/spec/features/auto_deploy_spec.rb index 3536d59bb0868927d1fe8eb86ffc6e383dd6e243..dff6f96b6635f505a55a72e2174d6e09c2a44056 100644 --- a/spec/features/auto_deploy_spec.rb +++ b/spec/features/auto_deploy_spec.rb @@ -7,7 +7,7 @@ describe 'Auto deploy' do before do create :kubernetes_service, project: project project.team << [user, :master] - gitlab_sign_in user + sign_in user end context 'when no deployment service is active' do diff --git a/spec/features/boards/add_issues_modal_spec.rb b/spec/features/boards/add_issues_modal_spec.rb index eeb63f3f81a0001ca1fbdbbba25936cf66a4e4e9..d883b467c678c3004496f66e2ebf0f813d2784f9 100644 --- a/spec/features/boards/add_issues_modal_spec.rb +++ b/spec/features/boards/add_issues_modal_spec.rb @@ -14,7 +14,7 @@ describe 'Issue Boards add issue modal', :feature, :js do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_board_path(project, board) wait_for_requests diff --git a/spec/features/boards/boards_spec.rb b/spec/features/boards/boards_spec.rb index 1f69758117973bb1ad12ecc970441e897f79e3df..3d7e26c7e1957a29e852ddac40b3ebf698bf3b08 100644 --- a/spec/features/boards/boards_spec.rb +++ b/spec/features/boards/boards_spec.rb @@ -12,7 +12,7 @@ describe 'Issue Boards', feature: true, js: true do project.team << [user, :master] project.team << [user2, :master] - gitlab_sign_in(user) + sign_in(user) end context 'no lists' do @@ -519,7 +519,7 @@ describe 'Issue Boards', feature: true, js: true do context 'signed out user' do before do - gitlab_sign_out + sign_out(:user) visit project_board_path(project, board) wait_for_requests end @@ -542,8 +542,8 @@ describe 'Issue Boards', feature: true, js: true do before do project.team << [user_guest, :guest] - gitlab_sign_out - gitlab_sign_in(user_guest) + sign_out(:user) + sign_in(user_guest) visit project_board_path(project, board) wait_for_requests end diff --git a/spec/features/boards/issue_ordering_spec.rb b/spec/features/boards/issue_ordering_spec.rb index 62693fb3d11a38835d9c153f60d33d6b116a3c61..17b0da8094791e2f0c491598ab1cc22aad397e84 100644 --- a/spec/features/boards/issue_ordering_spec.rb +++ b/spec/features/boards/issue_ordering_spec.rb @@ -15,7 +15,7 @@ describe 'Issue Boards', :feature, :js do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'un-ordered issues' do diff --git a/spec/features/boards/keyboard_shortcut_spec.rb b/spec/features/boards/keyboard_shortcut_spec.rb index 34ae6c9d81d3a272a3d853154b93fa9328972b65..8c16148023ecda1e3c7ea0c0115dbcca0bb170f7 100644 --- a/spec/features/boards/keyboard_shortcut_spec.rb +++ b/spec/features/boards/keyboard_shortcut_spec.rb @@ -6,7 +6,7 @@ describe 'Issue Boards shortcut', feature: true, js: true do before do create(:board, project: project) - gitlab_sign_in :admin + sign_in(create(:admin)) visit project_path(project) end diff --git a/spec/features/boards/modal_filter_spec.rb b/spec/features/boards/modal_filter_spec.rb index 40d1191a597610ebef8a7977d34f194c8b9e494e..ce05bb7175978394b1988a263c792546b7f0e9a8 100644 --- a/spec/features/boards/modal_filter_spec.rb +++ b/spec/features/boards/modal_filter_spec.rb @@ -12,7 +12,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end it 'shows empty state when no results found' do diff --git a/spec/features/boards/new_issue_spec.rb b/spec/features/boards/new_issue_spec.rb index fa9d8b3f33d40bc9ae06d7cd1921bd3973667986..6b267694201b656075f301b6739899bcea2af3f4 100644 --- a/spec/features/boards/new_issue_spec.rb +++ b/spec/features/boards/new_issue_spec.rb @@ -10,7 +10,7 @@ describe 'Issue Boards new issue', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_board_path(project, board) wait_for_requests diff --git a/spec/features/boards/sidebar_spec.rb b/spec/features/boards/sidebar_spec.rb index f96ceffbc7dd8a48f8b10c576e0113ae6ee6f202..fa17ef92bbb170e8a9d9fcc5e576c506dc58f8d7 100644 --- a/spec/features/boards/sidebar_spec.rb +++ b/spec/features/boards/sidebar_spec.rb @@ -20,7 +20,7 @@ describe 'Issue Boards', feature: true, js: true do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_board_path(project, board) wait_for_requests diff --git a/spec/features/boards/sub_group_project_spec.rb b/spec/features/boards/sub_group_project_spec.rb index ddff4737563cd2e79e59533a4fad88dbe0bec337..f88bf237301f1ee9dcb1be8a12ef5314612540fa 100644 --- a/spec/features/boards/sub_group_project_spec.rb +++ b/spec/features/boards/sub_group_project_spec.rb @@ -13,7 +13,7 @@ describe 'Sub-group project issue boards', :feature, :js do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) visit project_board_path(project, board) wait_for_requests diff --git a/spec/features/calendar_spec.rb b/spec/features/calendar_spec.rb index b2e72fc7dee4af29b0d5d962f4c51778244869df..adbd82e3057aab1a391f6e2e29be216eb544435e 100644 --- a/spec/features/calendar_spec.rb +++ b/spec/features/calendar_spec.rb @@ -68,7 +68,7 @@ feature 'Contributions Calendar', :feature, :js do end before do - gitlab_sign_in user + sign_in user end describe 'calendar day selection' do diff --git a/spec/features/ci_lint_spec.rb b/spec/features/ci_lint_spec.rb index de16ee3e567d2514b4edc686182b16c7c640c7b6..af4cc00162a4cbe2cff1045dba1911cd033c9c8c 100644 --- a/spec/features/ci_lint_spec.rb +++ b/spec/features/ci_lint_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'CI Lint', js: true do before do - gitlab_sign_in :user + sign_in(create(:user)) end describe 'YAML parsing' do diff --git a/spec/features/container_registry_spec.rb b/spec/features/container_registry_spec.rb index 55ef1ef29bd4a4b784a671246372cccaa0ec6d8f..8f59ce3d2e7880474dd256d4cc6fe5d5d7a43560 100644 --- a/spec/features/container_registry_spec.rb +++ b/spec/features/container_registry_spec.rb @@ -9,7 +9,7 @@ describe "Container Registry" do end before do - gitlab_sign_in(user) + sign_in(user) project.add_developer(user) stub_container_registry_config(enabled: true) stub_container_registry_tags(repository: :any, tags: []) diff --git a/spec/features/copy_as_gfm_spec.rb b/spec/features/copy_as_gfm_spec.rb index 25c5df56d57c79e6f061a738717fe5d32724be2b..11d5a4f421fca441b5c60e26e41baeb67bcfab82 100644 --- a/spec/features/copy_as_gfm_spec.rb +++ b/spec/features/copy_as_gfm_spec.rb @@ -6,7 +6,7 @@ describe 'Copy as GFM', feature: true, js: true do include ActionView::Helpers::JavaScriptHelper before do - gitlab_sign_in :admin + sign_in(create(:admin)) end describe 'Copying rendered GFM' do diff --git a/spec/features/cycle_analytics_spec.rb b/spec/features/cycle_analytics_spec.rb index 7825d23c8f929f95a04e813006277bf6fea470a8..f530063352ad5fb24271cb34fd0e6a345e0b8d11 100644 --- a/spec/features/cycle_analytics_spec.rb +++ b/spec/features/cycle_analytics_spec.rb @@ -14,7 +14,7 @@ feature 'Cycle Analytics', feature: true, js: true do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) visit project_cycle_analytics_path(project) wait_for_requests @@ -38,7 +38,7 @@ feature 'Cycle Analytics', feature: true, js: true do create_cycle deploy_master - gitlab_sign_in(user) + sign_in(user) visit project_cycle_analytics_path(project) end @@ -70,7 +70,7 @@ feature 'Cycle Analytics', feature: true, js: true do user.update_attribute(:preferred_language, 'es') project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_cycle_analytics_path(project) wait_for_requests end @@ -93,7 +93,7 @@ feature 'Cycle Analytics', feature: true, js: true do create_cycle deploy_master - gitlab_sign_in(guest) + sign_in(guest) visit project_cycle_analytics_path(project) wait_for_requests end diff --git a/spec/features/dashboard/active_tab_spec.rb b/spec/features/dashboard/active_tab_spec.rb index f7ddded10c1a24f3e4355b444eada0b16fce68cb..203d206b80b36a1dc79988113ddbb0e9e09444b7 100644 --- a/spec/features/dashboard/active_tab_spec.rb +++ b/spec/features/dashboard/active_tab_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' RSpec.describe 'Dashboard Active Tab', js: true, feature: true do before do - gitlab_sign_in :user + sign_in(create(:user)) end shared_examples 'page has active tab' do |title| diff --git a/spec/features/dashboard/activity_spec.rb b/spec/features/dashboard/activity_spec.rb index 1e9cabe7850bb21e2f36bdcc652dca34ca42c22f..ebfe7340eb73db04f438c77ca30060f3c7130e95 100644 --- a/spec/features/dashboard/activity_spec.rb +++ b/spec/features/dashboard/activity_spec.rb @@ -1,8 +1,10 @@ require 'spec_helper' RSpec.describe 'Dashboard Activity', feature: true do + let(:user) { create(:user) } + before do - gitlab_sign_in(create :user) + sign_in(user) visit activity_dashboard_path end diff --git a/spec/features/dashboard/archived_projects_spec.rb b/spec/features/dashboard/archived_projects_spec.rb index a5ba3e7e3cff6d47be81669852054b9dac0bd47e..dda4d517e395f7df88cb3ddae2b02df1cf13bef0 100644 --- a/spec/features/dashboard/archived_projects_spec.rb +++ b/spec/features/dashboard/archived_projects_spec.rb @@ -9,7 +9,7 @@ RSpec.describe 'Dashboard Archived Project', feature: true do project.team << [user, :master] archived_project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit dashboard_projects_path end diff --git a/spec/features/dashboard/datetime_on_tooltips_spec.rb b/spec/features/dashboard/datetime_on_tooltips_spec.rb index 6931d0a840ea59edb3760aa744091bc5554ebe75..8949267c82e1a18d0bc52f12a4a4bc8ade5bd660 100644 --- a/spec/features/dashboard/datetime_on_tooltips_spec.rb +++ b/spec/features/dashboard/datetime_on_tooltips_spec.rb @@ -13,7 +13,7 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do Event.create( project: project, author_id: user.id, action: Event::JOINED, updated_at: created_date, created_at: created_date) - gitlab_sign_in user + sign_in user visit user_path(user) wait_for_requests() @@ -30,7 +30,7 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do project.team << [user, :master] create(:snippet, author: user, updated_at: created_date, created_at: created_date) - gitlab_sign_in user + sign_in user visit user_snippets_path(user) wait_for_requests() diff --git a/spec/features/dashboard/group_spec.rb b/spec/features/dashboard/group_spec.rb index 2f7245950ec42c218bda9bf779e454ac4d19f886..ffaefb9c632b1924f86662ab4c85a82bc05146ba 100644 --- a/spec/features/dashboard/group_spec.rb +++ b/spec/features/dashboard/group_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' RSpec.describe 'Dashboard Group', feature: true do before do - gitlab_sign_in(:user) + sign_in(create(:user)) end it 'creates new group', js: true do diff --git a/spec/features/dashboard/groups_list_spec.rb b/spec/features/dashboard/groups_list_spec.rb index e520027bc38c6eb11286e9423a7f1e590da0de43..54a01e837de2f88144b981e8eddf057bcebf7c82 100644 --- a/spec/features/dashboard/groups_list_spec.rb +++ b/spec/features/dashboard/groups_list_spec.rb @@ -10,7 +10,7 @@ describe 'Dashboard Groups page', js: true, feature: true do group.add_owner(user) nested_group.add_owner(user) - gitlab_sign_in(user) + sign_in(user) visit dashboard_groups_path expect(page).to have_content(group.full_name) @@ -23,7 +23,7 @@ describe 'Dashboard Groups page', js: true, feature: true do group.add_owner(user) nested_group.add_owner(user) - gitlab_sign_in(user) + sign_in(user) visit dashboard_groups_path end @@ -58,7 +58,7 @@ describe 'Dashboard Groups page', js: true, feature: true do group.add_owner(user) subgroup.add_owner(user) - gitlab_sign_in(user) + sign_in(user) visit dashboard_groups_path end @@ -98,7 +98,7 @@ describe 'Dashboard Groups page', js: true, feature: true do allow(Kaminari.config).to receive(:default_per_page).and_return(1) - gitlab_sign_in(user) + sign_in(user) visit dashboard_groups_path end diff --git a/spec/features/dashboard/help_spec.rb b/spec/features/dashboard/help_spec.rb index 25b0f40c9cda8cccfc32735f884652f758c35d5c..fa7ea4c96b60fe482c93183ecdb3777c666b3d8d 100644 --- a/spec/features/dashboard/help_spec.rb +++ b/spec/features/dashboard/help_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' RSpec.describe 'Dashboard Help', feature: true do before do - gitlab_sign_in(:user) + sign_in(create(:user)) end it 'renders correctly markdown' do diff --git a/spec/features/dashboard/issuables_counter_spec.rb b/spec/features/dashboard/issuables_counter_spec.rb index 8a8a20fd5b1b884baf1fbf0ec6643e201039ed5a..285724f4b48a5bda2b0eb0a9c83860eb00803d6d 100644 --- a/spec/features/dashboard/issuables_counter_spec.rb +++ b/spec/features/dashboard/issuables_counter_spec.rb @@ -9,7 +9,7 @@ describe 'Navigation bar counter', feature: true, caching: true do before do issue.assignees = [user] merge_request.update(assignee: user) - gitlab_sign_in(user) + sign_in(user) end it 'reflects dashboard issues count' do diff --git a/spec/features/dashboard/issues_spec.rb b/spec/features/dashboard/issues_spec.rb index a57962abbda31b8e0b0ce9e5e22d818726e990af..86ac24ea06ecabe770763deb3108d49c6f6749a7 100644 --- a/spec/features/dashboard/issues_spec.rb +++ b/spec/features/dashboard/issues_spec.rb @@ -2,6 +2,7 @@ require 'spec_helper' RSpec.describe 'Dashboard Issues', feature: true do let(:current_user) { create :user } + let(:user) { current_user } # Shared examples depend on this being available let!(:public_project) { create(:empty_project, :public) } let(:project) { create(:empty_project) } let(:project_with_issues_disabled) { create(:empty_project, :issues_disabled) } @@ -12,7 +13,7 @@ RSpec.describe 'Dashboard Issues', feature: true do before do [project, project_with_issues_disabled].each { |project| project.team << [current_user, :master] } - gitlab_sign_in(current_user) + sign_in(current_user) visit issues_dashboard_path(assignee_id: current_user.id) end diff --git a/spec/features/dashboard/label_filter_spec.rb b/spec/features/dashboard/label_filter_spec.rb index 88bbb9e75b910653d78540384b33daf57b1cb6d2..8b7dacef913970100b3832f1493cd216c8fc14c8 100644 --- a/spec/features/dashboard/label_filter_spec.rb +++ b/spec/features/dashboard/label_filter_spec.rb @@ -11,7 +11,7 @@ describe 'Dashboard > label filter', feature: true, js: true do project.labels << label project2.labels << label2 - gitlab_sign_in(user) + sign_in(user) visit issues_dashboard_path end diff --git a/spec/features/dashboard/milestone_filter_spec.rb b/spec/features/dashboard/milestone_filter_spec.rb index b0e4036f27ced55633c2f76a3ef46cd4287ba38c..d06497041de436bcebe9274a17e07af9b9c040c0 100644 --- a/spec/features/dashboard/milestone_filter_spec.rb +++ b/spec/features/dashboard/milestone_filter_spec.rb @@ -11,7 +11,7 @@ feature 'Dashboard > milestone filter', :feature, :js do let!(:issue2) { create :issue, author: user, project: project, milestone: milestone2 } before do - gitlab_sign_in(user) + sign_in(user) visit issues_dashboard_path(author_id: user.id) end diff --git a/spec/features/dashboard/milestone_tabs_spec.rb b/spec/features/dashboard/milestone_tabs_spec.rb index cc4193b180f9e3555d8dff0de1dd5fcaf6d8da1e..8340a4f59df77c4be045765969c715c8aecb1f65 100644 --- a/spec/features/dashboard/milestone_tabs_spec.rb +++ b/spec/features/dashboard/milestone_tabs_spec.rb @@ -15,7 +15,7 @@ describe 'Dashboard milestone tabs', :js, :feature do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) visit dashboard_milestone_path(milestone.safe_title, title: milestone.title) end diff --git a/spec/features/dashboard/projects_spec.rb b/spec/features/dashboard/projects_spec.rb index 7d1fe2bd43517a02eb0b1adce37e3de27cc6c884..7ca002fc82181e6384efffd21cd8d72fb34fd990 100644 --- a/spec/features/dashboard/projects_spec.rb +++ b/spec/features/dashboard/projects_spec.rb @@ -7,7 +7,13 @@ feature 'Dashboard Projects' do before do project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) + end + + it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token" do + before do + visit dashboard_projects_path + end end it 'shows the project the user in a member of in the list' do @@ -71,6 +77,4 @@ feature 'Dashboard Projects' do expect(page).to have_xpath("//a[@href='#{pipelines_project_commit_path(project, project.commit)}']") end end - - it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token" end diff --git a/spec/features/dashboard/shortcuts_spec.rb b/spec/features/dashboard/shortcuts_spec.rb index 525b0e1b2107e715dbeee09af02887e32281a612..bb29dae1bdc66fb88d04170b51c81068f49871b4 100644 --- a/spec/features/dashboard/shortcuts_spec.rb +++ b/spec/features/dashboard/shortcuts_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' feature 'Dashboard shortcuts', :feature, :js do context 'logged in' do before do - gitlab_sign_in :user + sign_in(create(:user)) visit root_dashboard_path end diff --git a/spec/features/dashboard/snippets_spec.rb b/spec/features/dashboard/snippets_spec.rb index 0c069ae5cf047359a0423548088b49db47138741..c5ae9aad9c6002d078f9c6260f41359feb11ef96 100644 --- a/spec/features/dashboard/snippets_spec.rb +++ b/spec/features/dashboard/snippets_spec.rb @@ -6,7 +6,7 @@ describe 'Dashboard snippets', feature: true do let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) } before do allow(Snippet).to receive(:default_per_page).and_return(1) - gitlab_sign_in(project.owner) + sign_in(project.owner) visit dashboard_snippets_path end @@ -25,7 +25,7 @@ describe 'Dashboard snippets', feature: true do end before do - gitlab_sign_in(user) + sign_in(user) visit dashboard_snippets_path end diff --git a/spec/features/dashboard/todos/todos_sorting_spec.rb b/spec/features/dashboard/todos/todos_sorting_spec.rb index 5858f4aa101bf498db5909dd34e10aca4e435128..d49a78b290fec0e80de8954c58fbab17d77013a9 100644 --- a/spec/features/dashboard/todos/todos_sorting_spec.rb +++ b/spec/features/dashboard/todos/todos_sorting_spec.rb @@ -83,7 +83,7 @@ feature 'Dashboard > User sorts todos' do create(:todo, user: user, project: project, target: issue_2) create(:todo, user: user, project: project, target: merge_request_1) - gitlab_sign_in(user) + sign_in(user) visit dashboard_todos_path end diff --git a/spec/features/dashboard/user_filters_projects_spec.rb b/spec/features/dashboard/user_filters_projects_spec.rb index e9f34760143b5af473cb807668bcca7cc4c2d966..711d3617335f07c1f0ca3fff3b5e07515005098b 100644 --- a/spec/features/dashboard/user_filters_projects_spec.rb +++ b/spec/features/dashboard/user_filters_projects_spec.rb @@ -9,7 +9,7 @@ describe 'Dashboard > User filters projects', :feature do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end describe 'filtering personal projects' do diff --git a/spec/features/dashboard_issues_spec.rb b/spec/features/dashboard_issues_spec.rb index c4dbaad2895836967e4da23ced815d4b791043c4..f235fef1aa484d42ab4af9ee6704a5d4958f7b43 100644 --- a/spec/features/dashboard_issues_spec.rb +++ b/spec/features/dashboard_issues_spec.rb @@ -8,7 +8,7 @@ describe "Dashboard Issues filtering", feature: true, js: true do context 'filtering by milestone' do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) create(:issue, project: project, author: user, assignees: [user]) create(:issue, project: project, author: user, assignees: [user], milestone: milestone) diff --git a/spec/features/dashboard_milestones_spec.rb b/spec/features/dashboard_milestones_spec.rb index b308a2297b949744eb05f33a2b664fcc1727f3b9..7a6a448d4c2bce3ce1ef109f873062592b9f060b 100644 --- a/spec/features/dashboard_milestones_spec.rb +++ b/spec/features/dashboard_milestones_spec.rb @@ -17,7 +17,7 @@ feature 'Dashboard > Milestones', feature: true do let!(:milestone) { create(:milestone, project: project) } before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit dashboard_milestones_path end diff --git a/spec/features/discussion_comments/commit_spec.rb b/spec/features/discussion_comments/commit_spec.rb index 620184e29330bc5d54813b50de86c0ab3ddabf92..26d21207678d181d65a53a8134ac45b82f2d5eed 100644 --- a/spec/features/discussion_comments/commit_spec.rb +++ b/spec/features/discussion_comments/commit_spec.rb @@ -9,7 +9,7 @@ describe 'Discussion Comments Merge Request', :feature, :js do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) visit project_commit_path(project, sample_commit.id) end diff --git a/spec/features/discussion_comments/issue_spec.rb b/spec/features/discussion_comments/issue_spec.rb index f90f82f8a4813056be8cc088bc80ab1737b1cd1d..11dbe10e1df2de08b216b6e1f002f8060d3d3b6c 100644 --- a/spec/features/discussion_comments/issue_spec.rb +++ b/spec/features/discussion_comments/issue_spec.rb @@ -7,7 +7,7 @@ describe 'Discussion Comments Issue', :feature, :js do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) visit project_issue_path(project, issue) end diff --git a/spec/features/discussion_comments/merge_request_spec.rb b/spec/features/discussion_comments/merge_request_spec.rb index 577d9c69bbc0a8a0ca740f836f2da7c413e985cc..db745be6fa13719d0a791225eb61ad70df8a67cc 100644 --- a/spec/features/discussion_comments/merge_request_spec.rb +++ b/spec/features/discussion_comments/merge_request_spec.rb @@ -7,7 +7,7 @@ describe 'Discussion Comments Merge Request', :feature, :js do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) visit project_merge_request_path(project, merge_request) end diff --git a/spec/features/discussion_comments/snippets_spec.rb b/spec/features/discussion_comments/snippets_spec.rb index a59be88db7db3b4872db7ac3f1fa3e2cbb0d3870..eddbd4bde9bf0354b297a08d638250580ce2bf8e 100644 --- a/spec/features/discussion_comments/snippets_spec.rb +++ b/spec/features/discussion_comments/snippets_spec.rb @@ -7,7 +7,7 @@ describe 'Discussion Comments Issue', :feature, :js do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) visit project_snippet_path(project, snippet) end diff --git a/spec/features/expand_collapse_diffs_spec.rb b/spec/features/expand_collapse_diffs_spec.rb index f45752ab3f33de8dc3eac3971e40da342e64f683..18c06a48111ea16a74a3286a9ffe544aa38f6a69 100644 --- a/spec/features/expand_collapse_diffs_spec.rb +++ b/spec/features/expand_collapse_diffs_spec.rb @@ -10,7 +10,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do allow(Gitlab::Git::Diff).to receive(:size_limit).and_return(100.kilobytes) allow(Gitlab::Git::Diff).to receive(:collapse_limit).and_return(10.kilobytes) - gitlab_sign_in :admin + sign_in(create(:admin)) # Ensure that undiffable.md is in .gitattributes project.repository.copy_gitattributes(branch) diff --git a/spec/features/explore/groups_list_spec.rb b/spec/features/explore/groups_list_spec.rb index 6be5dee0c3c52ea6e55d8c8e9fabcd29e5a37875..008d12714cc61abf32dc2e2866df1f8787573b8a 100644 --- a/spec/features/explore/groups_list_spec.rb +++ b/spec/features/explore/groups_list_spec.rb @@ -10,7 +10,7 @@ describe 'Explore Groups page', :js, :feature do before do group.add_owner(user) - gitlab_sign_in(user) + sign_in(user) visit explore_groups_path end diff --git a/spec/features/explore/new_menu_spec.rb b/spec/features/explore/new_menu_spec.rb index 5cd72e1d24956dda6ea9f8c6009c8e5ca28a44fa..7dd69f550accc082c8e7ce0d2b5c3e45292efbb8 100644 --- a/spec/features/explore/new_menu_spec.rb +++ b/spec/features/explore/new_menu_spec.rb @@ -16,7 +16,7 @@ feature 'Top Plus Menu', feature: true, js: true do context 'used by full user' do before do - gitlab_sign_in(user) + sign_in(user) end scenario 'click on New project shows new project page' do @@ -103,7 +103,7 @@ feature 'Top Plus Menu', feature: true, js: true do context 'used by guest user' do before do - gitlab_sign_in(guest_user) + sign_in(guest_user) end scenario 'click on New issue shows new issue page' do diff --git a/spec/features/global_search_spec.rb b/spec/features/global_search_spec.rb index 54ebfe6cf77acab933a9367fa1d52281c5133299..efa5e95de8923fcd0e14a8b5adb8aa51818e7f70 100644 --- a/spec/features/global_search_spec.rb +++ b/spec/features/global_search_spec.rb @@ -6,7 +6,7 @@ feature 'Global search', feature: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end describe 'I search through the issues and I see pagination' do diff --git a/spec/features/groups/activity_spec.rb b/spec/features/groups/activity_spec.rb index 9f66a3d8c72337943516cc68d28bece76959905a..262d9434ddf7b0ce74ee291656471e374b2b9b44 100644 --- a/spec/features/groups/activity_spec.rb +++ b/spec/features/groups/activity_spec.rb @@ -1,13 +1,13 @@ require 'spec_helper' feature 'Group activity page', feature: true do + let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user } let(:group) { create(:group) } let(:path) { activity_group_path(group) } context 'when signed in' do before do - user = create(:group_member, :developer, user: create(:user), group: group ).user - gitlab_sign_in(user) + sign_in(user) visit path end diff --git a/spec/features/groups/empty_states_spec.rb b/spec/features/groups/empty_states_spec.rb index b1c7151dfa86c13e8d5bc9460cf90005ba0d0f29..e2c7907528b81bfa7eed2a9495a40a355772d619 100644 --- a/spec/features/groups/empty_states_spec.rb +++ b/spec/features/groups/empty_states_spec.rb @@ -5,7 +5,7 @@ feature 'Groups Merge Requests Empty States' do let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user } before do - gitlab_sign_in(user) + sign_in(user) end context 'group has a project' do diff --git a/spec/features/groups/group_name_toggle_spec.rb b/spec/features/groups/group_name_toggle_spec.rb index f450626c37076843ea527a4d05df2eb4591b2e6d..ea779a3baf05bb49bdd1ce2baec9355bca9f65a2 100644 --- a/spec/features/groups/group_name_toggle_spec.rb +++ b/spec/features/groups/group_name_toggle_spec.rb @@ -9,7 +9,7 @@ feature 'Group name toggle', feature: true, js: true do SMALL_SCREEN = 300 before do - gitlab_sign_in :user + sign_in(create(:user)) end it 'is not present if enough horizontal space' do diff --git a/spec/features/groups/group_settings_spec.rb b/spec/features/groups/group_settings_spec.rb index 56e163ec4d0259a8ae8787f9bb6852b8ab106bc3..f7ef7f29066ab42f410750e42b263b67bfc0c2db 100644 --- a/spec/features/groups/group_settings_spec.rb +++ b/spec/features/groups/group_settings_spec.rb @@ -6,7 +6,7 @@ feature 'Edit group settings', feature: true do background do group.add_owner(user) - gitlab_sign_in(user) + sign_in(user) end describe 'when the group path is changed' do diff --git a/spec/features/groups/labels/edit_spec.rb b/spec/features/groups/labels/edit_spec.rb index b33040ef843a662d590f946a7f17f79f4b2fe289..88d104d5a0669718c3f399b573170c3e37d9eeff 100644 --- a/spec/features/groups/labels/edit_spec.rb +++ b/spec/features/groups/labels/edit_spec.rb @@ -7,7 +7,7 @@ feature 'Edit group label', feature: true do background do group.add_owner(user) - gitlab_sign_in(user) + sign_in(user) visit edit_group_label_path(group, label) end diff --git a/spec/features/groups/members/manage_access_requests_spec.rb b/spec/features/groups/members/manage_access_requests_spec.rb index f84d8594c65292ca73d84fbf2ee94df683b406fe..51a4d769b9cef084d65db59b3d7a6362a4152b40 100644 --- a/spec/features/groups/members/manage_access_requests_spec.rb +++ b/spec/features/groups/members/manage_access_requests_spec.rb @@ -8,7 +8,7 @@ feature 'Groups > Members > Manage access requests', feature: true do background do group.request_access(user) group.add_owner(owner) - gitlab_sign_in(owner) + sign_in(owner) end scenario 'owner can see access requests' do diff --git a/spec/features/groups/members/manage_members.rb b/spec/features/groups/members/manage_members.rb index a9a654b20e2f66a68c903fb7276eee5d6e02a91f..4b226893701f72290e12f6117c912ec0ff2cf4e3 100644 --- a/spec/features/groups/members/manage_members.rb +++ b/spec/features/groups/members/manage_members.rb @@ -8,7 +8,7 @@ feature 'Groups > Members > Manage members', feature: true do let(:group) { create(:group) } background do - gitlab_sign_in(user1) + sign_in(user1) end scenario 'update user to owner level', :js do diff --git a/spec/features/groups/members/request_access_spec.rb b/spec/features/groups/members/request_access_spec.rb index 41c31b62e18ad9b281dc52067cad452a78de5b6e..3764e4792cae3df03dc79175a1e566bdd39d96f6 100644 --- a/spec/features/groups/members/request_access_spec.rb +++ b/spec/features/groups/members/request_access_spec.rb @@ -8,7 +8,7 @@ feature 'Groups > Members > Request access', feature: true do background do group.add_owner(owner) - gitlab_sign_in(user) + sign_in(user) visit group_path(group) end diff --git a/spec/features/groups/members/sort_members_spec.rb b/spec/features/groups/members/sort_members_spec.rb index 8ee6195384480c0471dded63932fde39610c9a4d..169827f5d0d20e0e20959c874e7feb5e4879fbf2 100644 --- a/spec/features/groups/members/sort_members_spec.rb +++ b/spec/features/groups/members/sort_members_spec.rb @@ -9,7 +9,7 @@ feature 'Groups > Members > Sort members', feature: true do create(:group_member, :owner, user: owner, group: group, created_at: 5.days.ago) create(:group_member, :developer, user: developer, group: group, created_at: 3.days.ago) - gitlab_sign_in(owner) + sign_in(owner) end scenario 'sorts alphabetically by default' do diff --git a/spec/features/groups/milestone_spec.rb b/spec/features/groups/milestone_spec.rb index 9b6eb946f4bcedce9f94fb3acc71e2fe72018164..0f3f005040f832871118985b1ba5786e37f76660 100644 --- a/spec/features/groups/milestone_spec.rb +++ b/spec/features/groups/milestone_spec.rb @@ -8,7 +8,7 @@ feature 'Group milestones', :feature, :js do before do Timecop.freeze - gitlab_sign_in(user) + sign_in(user) end after do diff --git a/spec/features/groups/show_spec.rb b/spec/features/groups/show_spec.rb index 76575f61528863504179f3bfafc52cb96903d7d7..cbf97d0674b3b37ae90afe6d156ba6fa43aaab98 100644 --- a/spec/features/groups/show_spec.rb +++ b/spec/features/groups/show_spec.rb @@ -5,9 +5,12 @@ feature 'Group show page', feature: true do let(:path) { group_path(group) } context 'when signed in' do + let(:user) do + create(:group_member, :developer, user: create(:user), group: group ).user + end + before do - user = create(:group_member, :developer, user: create(:user), group: group ).user - gitlab_sign_in(user) + sign_in(user) visit path end diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb index c1dc7be70880986dfd44e3325988057a8cb7015f..6f8c8999f98e3a39e6dde6409c98594d6eda7061 100644 --- a/spec/features/groups_spec.rb +++ b/spec/features/groups_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Group', feature: true do before do - gitlab_sign_in(:admin) + sign_in(create(:admin)) end matcher :have_namespace_error_message do @@ -108,8 +108,8 @@ feature 'Group', feature: true do before do group.add_owner(user) - gitlab_sign_out - gitlab_sign_in(user) + sign_out(:user) + sign_in(user) visit subgroups_group_path(group) click_link 'New Subgroup' @@ -128,8 +128,8 @@ feature 'Group', feature: true do it 'checks permissions to avoid exposing groups by parent_id' do group = create(:group, :private, path: 'secret-group') - gitlab_sign_out - gitlab_sign_in(:user) + sign_out(:user) + sign_in(create(:user)) visit new_group_path(parent_id: group.id) expect(page).not_to have_content('secret-group') diff --git a/spec/features/help_pages_spec.rb b/spec/features/help_pages_spec.rb index b01ee1cf491979fbd71f14572f3da13b0854fc71..7fe65ee554de6176e63e45eb68ea9a1ac79b363c 100644 --- a/spec/features/help_pages_spec.rb +++ b/spec/features/help_pages_spec.rb @@ -40,7 +40,7 @@ describe 'Help Pages', feature: true do allow_any_instance_of(ApplicationSetting).to receive(:version_check_enabled) { true } allow_any_instance_of(VersionCheck).to receive(:url) { '/version-check-url' } - gitlab_sign_in :user + sign_in(create(:user)) visit help_path end @@ -60,7 +60,7 @@ describe 'Help Pages', feature: true do allow_any_instance_of(ApplicationSetting).to receive(:help_page_text) { "My Custom Text" } allow_any_instance_of(ApplicationSetting).to receive(:help_page_support_url) { "http://example.com/help" } - gitlab_sign_in(:user) + sign_in(create(:user)) visit help_path end diff --git a/spec/features/issuables/issuable_list_spec.rb b/spec/features/issuables/issuable_list_spec.rb index 5046bfb59492381c44ce0c1bc2f498950de60a34..32fee2d9c3453ab0810c867c3c758df0342bf2dd 100644 --- a/spec/features/issuables/issuable_list_spec.rb +++ b/spec/features/issuables/issuable_list_spec.rb @@ -8,7 +8,7 @@ describe 'issuable list', feature: true do before do project.add_user(user, :developer) - gitlab_sign_in(user) + sign_in(user) issuable_types.each { |type| create_issuables(type) } end diff --git a/spec/features/issues/award_emoji_spec.rb b/spec/features/issues/award_emoji_spec.rb index 2c84965f7f3357562d80bc84715fb8b761c2ff33..823c779e0d96d02c853e4d03445329cac2aa46df 100644 --- a/spec/features/issues/award_emoji_spec.rb +++ b/spec/features/issues/award_emoji_spec.rb @@ -12,7 +12,7 @@ describe 'Awards Emoji', feature: true do context 'authorized user' do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end describe 'visiting an issue with a legacy award emoji that is not valid anymore' do diff --git a/spec/features/issues/award_spec.rb b/spec/features/issues/award_spec.rb index 62c5fce81b6db67d3564fc79fc3b808a8bbd921c..76cffc1d8c948feaf54c299afb83107032def144 100644 --- a/spec/features/issues/award_spec.rb +++ b/spec/features/issues/award_spec.rb @@ -7,7 +7,7 @@ feature 'Issue awards', js: true, feature: true do describe 'logged in' do before do - gitlab_sign_in(user) + sign_in(user) visit project_issue_path(project, issue) wait_for_requests end diff --git a/spec/features/issues/bulk_assignment_labels_spec.rb b/spec/features/issues/bulk_assignment_labels_spec.rb index 86226d97f79e5a1351795311a29d5fa3fba347d4..034d8afb54d9a0e42e69b8901500c16762721bd2 100644 --- a/spec/features/issues/bulk_assignment_labels_spec.rb +++ b/spec/features/issues/bulk_assignment_labels_spec.rb @@ -13,7 +13,7 @@ feature 'Issues > Labels bulk assignment', feature: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user end context 'sidebar' do @@ -346,7 +346,7 @@ feature 'Issues > Labels bulk assignment', feature: true do context 'as a guest' do before do - gitlab_sign_in user + sign_in user visit project_issues_path(project) end diff --git a/spec/features/issues/create_branch_merge_request_spec.rb b/spec/features/issues/create_branch_merge_request_spec.rb index f730141f82c023f6eebf894ad2f47620b71da90b..6e778f4d7e5ef83066603e9c7e52bc968aff68a3 100644 --- a/spec/features/issues/create_branch_merge_request_spec.rb +++ b/spec/features/issues/create_branch_merge_request_spec.rb @@ -8,7 +8,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js: context 'for team members' do before do project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) end it 'allows creating a merge request from the issue page' do diff --git a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb index 3b7622882c17e694b3a1600f4ada9921d14d7fb9..dd9a7f1253d3864ee655654893dbc9582f110ae8 100644 --- a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb +++ b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb @@ -9,7 +9,7 @@ feature 'Resolving all open discussions in a merge request from an issue', featu describe 'as a user with access to the project' do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_merge_request_path(project, merge_request) end @@ -82,7 +82,7 @@ feature 'Resolving all open discussions in a merge request from an issue', featu describe 'as a reporter' do before do project.team << [user, :reporter] - gitlab_sign_in user + sign_in user visit new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) end diff --git a/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb b/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb index 97d49184920a4c273b4fed130f41fa1036b832e9..5c291f7b81751e97062beae03188d6799ed474d7 100644 --- a/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb +++ b/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb @@ -9,7 +9,7 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe describe 'As a user with access to the project' do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_merge_request_path(project, merge_request) end @@ -66,10 +66,9 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe describe 'as a reporter' do before do project.team << [user, :reporter] - gitlab_sign_in user - visit new_project_issue_path(project, - merge_request_to_resolve_discussions_of: merge_request.iid, - discussion_to_resolve: discussion.id) + sign_in user + visit new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid, + discussion_to_resolve: discussion.id) end it 'Shows a notice to ask someone else to resolve the discussions' do diff --git a/spec/features/issues/filtered_search/dropdown_assignee_spec.rb b/spec/features/issues/filtered_search/dropdown_assignee_spec.rb index 211f7eec560a7d593e5169e806f26f06bb42b292..2765d5448a4912cbd3f4492e070aec3fbe70093c 100644 --- a/spec/features/issues/filtered_search/dropdown_assignee_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_assignee_spec.rb @@ -23,7 +23,7 @@ describe 'Dropdown assignee', :feature, :js do project.team << [user, :master] project.team << [user_john, :master] project.team << [user_jacob, :master] - gitlab_sign_in(user) + sign_in(user) create(:issue, project: project) visit project_issues_path(project) diff --git a/spec/features/issues/filtered_search/dropdown_author_spec.rb b/spec/features/issues/filtered_search/dropdown_author_spec.rb index 364c5564a1c82edd3f027c930cf7c95e95dd9c23..98b1c5ee1b5401882e707970d410929f38a9b1b1 100644 --- a/spec/features/issues/filtered_search/dropdown_author_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_author_spec.rb @@ -31,7 +31,7 @@ describe 'Dropdown author', js: true, feature: true do project.team << [user, :master] project.team << [user_john, :master] project.team << [user_jacob, :master] - gitlab_sign_in(user) + sign_in(user) create(:issue, project: project) visit project_issues_path(project) diff --git a/spec/features/issues/filtered_search/dropdown_hint_spec.rb b/spec/features/issues/filtered_search/dropdown_hint_spec.rb index 14c506eead3949ca817f6c5f4e318dced7e904df..fdc003f81b3a62bf18d77ad82bec883da44b39cb 100644 --- a/spec/features/issues/filtered_search/dropdown_hint_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_hint_spec.rb @@ -14,7 +14,7 @@ describe 'Dropdown hint', :js, :feature do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) create(:issue, project: project) visit project_issues_path(project) diff --git a/spec/features/issues/filtered_search/dropdown_label_spec.rb b/spec/features/issues/filtered_search/dropdown_label_spec.rb index 04d2b39dbf2b5a954f20af1008c40c00a18fd8a8..26a0320675f261946f18316c7d3263480246a0f4 100644 --- a/spec/features/issues/filtered_search/dropdown_label_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_label_spec.rb @@ -34,7 +34,7 @@ describe 'Dropdown label', js: true, feature: true do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) create(:issue, project: project) visit project_issues_path(project) diff --git a/spec/features/issues/filtered_search/dropdown_milestone_spec.rb b/spec/features/issues/filtered_search/dropdown_milestone_spec.rb index 1507e9f76166f00b9b2d81f6887338801e06263c..7c74d8dffff4d0890868ee027ea0887512ce3921 100644 --- a/spec/features/issues/filtered_search/dropdown_milestone_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_milestone_spec.rb @@ -30,7 +30,7 @@ describe 'Dropdown milestone', :feature, :js do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) create(:issue, project: project) visit project_issues_path(project) diff --git a/spec/features/issues/filtered_search/search_bar_spec.rb b/spec/features/issues/filtered_search/search_bar_spec.rb index 5b67d062f15eb56e3a50f62038c5e951eb037d36..b16c5c280c730e4684d36241edccb001d968dfd9 100644 --- a/spec/features/issues/filtered_search/search_bar_spec.rb +++ b/spec/features/issues/filtered_search/search_bar_spec.rb @@ -9,7 +9,7 @@ describe 'Search bar', js: true, feature: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) create(:issue, project: project) visit project_issues_path(project) diff --git a/spec/features/issues/filtered_search/visual_tokens_spec.rb b/spec/features/issues/filtered_search/visual_tokens_spec.rb index e40cfd0960160d5dd59524e38bb0a69962854cb9..a15c3d1d447c15045acd39d6abe81b2ca5fb8a99 100644 --- a/spec/features/issues/filtered_search/visual_tokens_spec.rb +++ b/spec/features/issues/filtered_search/visual_tokens_spec.rb @@ -25,7 +25,7 @@ describe 'Visual tokens', js: true, feature: true do before do project.add_user(user, :master) project.add_user(user_rock, :master) - gitlab_sign_in(user) + sign_in(user) create(:issue, project: project) visit project_issues_path(project) diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index 4a2ca243755f9d62381743d362b2b994feb6d51e..05742004f06d9ba06907966f740ef52e7f2b6c95 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -15,7 +15,7 @@ describe 'New/edit issue', :feature, :js do before do project.team << [user, :master] project.team << [user2, :master] - gitlab_sign_in(user) + sign_in(user) end context 'new issue' do diff --git a/spec/features/issues/gfm_autocomplete_spec.rb b/spec/features/issues/gfm_autocomplete_spec.rb index fbfae02ff4aa9d66dfebb3c053f0fc5376984a60..9b4cc653af5140e2b1ea36105d1c82e1451f858f 100644 --- a/spec/features/issues/gfm_autocomplete_spec.rb +++ b/spec/features/issues/gfm_autocomplete_spec.rb @@ -8,7 +8,7 @@ feature 'GFM autocomplete', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_issue_path(project, issue) wait_for_requests diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb index 8d9bfcdf4e0ce10ec38686da68bf35d38e3830da..f75d2c7267291fcafd0ed86423dae2c47842bea7 100644 --- a/spec/features/issues/issue_sidebar_spec.rb +++ b/spec/features/issues/issue_sidebar_spec.rb @@ -10,7 +10,7 @@ feature 'Issue Sidebar', feature: true do let!(:label) { create(:label, project: project, title: 'bug') } before do - gitlab_sign_in(user) + sign_in(user) end context 'assignee', js: true do diff --git a/spec/features/issues/markdown_toolbar_spec.rb b/spec/features/issues/markdown_toolbar_spec.rb index 396b53556bf2cea13fb98188cd610c6dee32a28f..affba35f61c746eef2e5a92aeb34997607cfa83d 100644 --- a/spec/features/issues/markdown_toolbar_spec.rb +++ b/spec/features/issues/markdown_toolbar_spec.rb @@ -6,7 +6,7 @@ feature 'Issue markdown toolbar', feature: true, js: true do let(:user) { create(:user) } before do - gitlab_sign_in(user) + sign_in(user) visit project_issue_path(project, issue) end diff --git a/spec/features/issues/move_spec.rb b/spec/features/issues/move_spec.rb index 568f2393aef98e26898ca67cc23bdb0e1b8fc6cc..833eb47efb2198e315502ffed5f7b392b9b47480 100644 --- a/spec/features/issues/move_spec.rb +++ b/spec/features/issues/move_spec.rb @@ -9,7 +9,7 @@ feature 'issue move to another project' do create(:issue, description: text, project: old_project, author: user) end - background { gitlab_sign_in(user) } + background { sign_in(user) } context 'user does not have permission to move issue' do background do diff --git a/spec/features/issues/note_polling_spec.rb b/spec/features/issues/note_polling_spec.rb index 580b8d03fef65bb75e4c2c3507b119b8c23c9888..184cde5b9c55fa2151ffe8ab0a3f89492fe38db8 100644 --- a/spec/features/issues/note_polling_spec.rb +++ b/spec/features/issues/note_polling_spec.rb @@ -27,7 +27,7 @@ feature 'Issue notes polling', :feature, :js do let!(:existing_note) { create(:note, noteable: issue, project: project, author: user, note: note_text) } before do - gitlab_sign_in(user) + sign_in(user) visit project_issue_path(project, issue) end @@ -93,7 +93,7 @@ feature 'Issue notes polling', :feature, :js do let!(:existing_note) { create(:note, noteable: issue, project: project, author: user1, note: note_text) } before do - gitlab_sign_in(user2) + sign_in(user2) visit project_issue_path(project, issue) end @@ -114,7 +114,7 @@ feature 'Issue notes polling', :feature, :js do let!(:system_note) { create(:system_note, noteable: issue, project: project, author: user, note: note_text) } before do - gitlab_sign_in(user) + sign_in(user) visit project_issue_path(project, issue) end diff --git a/spec/features/issues/notes_on_issues_spec.rb b/spec/features/issues/notes_on_issues_spec.rb index 1871d853a9019afe0cd3e414fbd9c3ca1fd95bf1..6fb103e54779c3dbc242471c9a3559ad5b57fa1d 100644 --- a/spec/features/issues/notes_on_issues_spec.rb +++ b/spec/features/issues/notes_on_issues_spec.rb @@ -9,7 +9,7 @@ describe 'Create notes on issues', :js, :feature do before do project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) visit project_issue_path(project, issue) fill_in 'note[note]', with: note_text diff --git a/spec/features/issues/spam_issues_spec.rb b/spec/features/issues/spam_issues_spec.rb index 76dae9212ddd8b58a8979f81bcd6925a532c108c..39a458fe3d08670ce1ad94e6ac9245f8bf5e64d9 100644 --- a/spec/features/issues/spam_issues_spec.rb +++ b/spec/features/issues/spam_issues_spec.rb @@ -18,7 +18,7 @@ describe 'New issue', feature: true, js: true do ) project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'when identified as a spam' do diff --git a/spec/features/issues/todo_spec.rb b/spec/features/issues/todo_spec.rb index 1bcd717e8ddf633e07d10bdaadaf5094f08cec75..f57b58f68e3d010f9747130b6587e9659caec209 100644 --- a/spec/features/issues/todo_spec.rb +++ b/spec/features/issues/todo_spec.rb @@ -7,7 +7,7 @@ feature 'Manually create a todo item from issue', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_issue_path(project, issue) end diff --git a/spec/features/issues/user_uses_slash_commands_spec.rb b/spec/features/issues/user_uses_slash_commands_spec.rb index ad28decfc007d31cb0a51e3c96e05fbe247b7d6f..1cd1f0166744229b0f075e0f712ddacddb781102 100644 --- a/spec/features/issues/user_uses_slash_commands_spec.rb +++ b/spec/features/issues/user_uses_slash_commands_spec.rb @@ -13,7 +13,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_issue_path(project, issue) end @@ -42,7 +42,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do before do project.team << [guest, :guest] gitlab_sign_out - gitlab_sign_in(guest) + sign_in(guest) visit project_issue_path(project, issue) end @@ -82,7 +82,7 @@ feature 'Issues > User uses quick actions', feature: true, js: true do before do project.team << [guest, :guest] gitlab_sign_out - gitlab_sign_in(guest) + sign_in(guest) visit project_issue_path(project, issue) end @@ -125,32 +125,6 @@ feature 'Issues > User uses quick actions', feature: true, js: true do end end - describe 'Issuable time tracking' do - let(:issue) { create(:issue, project: project) } - - before do - project.team << [user, :developer] - end - - context 'Issue' do - before do - visit project_issue_path(project, issue) - end - - it_behaves_like 'issuable time tracker' - end - - context 'Merge Request' do - let(:merge_request) { create(:merge_request, source_project: project) } - - before do - visit project_merge_request_path(project, merge_request) - end - - it_behaves_like 'issuable time tracker' - end - end - describe 'toggling the WIP prefix from the title from note' do let(:issue) { create(:issue, project: project) } diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index 8cb62910e18d821598dcf0fe7aa09366c2fa70a4..0016fa10f672fe839c534556709952387e94547f 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -571,8 +571,6 @@ describe 'Issues', feature: true do expect(current_path).to eq new_user_session_path - # NOTE: This is specifically testing the redirect after login, so we - # need the full login flow gitlab_sign_in(create(:user)) expect(current_path).to eq new_project_issue_path(project) diff --git a/spec/features/merge_requests/assign_issues_spec.rb b/spec/features/merge_requests/assign_issues_spec.rb index 9d9a31ab8e84841042f0fb2a9c40f0e89bb72341..985f42e484c42e87ccbde25bc771bf0b5ba83924 100644 --- a/spec/features/merge_requests/assign_issues_spec.rb +++ b/spec/features/merge_requests/assign_issues_spec.rb @@ -13,7 +13,7 @@ feature 'Merge request issue assignment', js: true, feature: true do end def visit_merge_request(current_user = nil) - gitlab_sign_in(current_user || user) + sign_in(current_user || user) visit project_merge_request_path(project, merge_request) end diff --git a/spec/features/merge_requests/award_spec.rb b/spec/features/merge_requests/award_spec.rb index ed5a4fa5784d7fd85dca14affc5cd39ba19b068d..3b01c763281bc94dee4cbed812737a3e7adc9335 100644 --- a/spec/features/merge_requests/award_spec.rb +++ b/spec/features/merge_requests/award_spec.rb @@ -7,7 +7,7 @@ feature 'Merge request awards', js: true, feature: true do describe 'logged in' do before do - gitlab_sign_in(user) + sign_in(user) visit project_merge_request_path(project, merge_request) end diff --git a/spec/features/merge_requests/check_if_mergeable_with_unresolved_discussions_spec.rb b/spec/features/merge_requests/check_if_mergeable_with_unresolved_discussions_spec.rb index 0f8ab4cd92bc3426e90c3c6addde71323ae090ab..f2d6c0d9769f04e0b7b0fe528abdb5765bbe8e22 100644 --- a/spec/features/merge_requests/check_if_mergeable_with_unresolved_discussions_spec.rb +++ b/spec/features/merge_requests/check_if_mergeable_with_unresolved_discussions_spec.rb @@ -6,7 +6,7 @@ feature 'Check if mergeable with unresolved discussions', js: true, feature: tru let!(:merge_request) { create(:merge_request_with_diff_notes, source_project: project, author: user) } before do - gitlab_sign_in user + sign_in user project.team << [user, :master] end diff --git a/spec/features/merge_requests/cherry_pick_spec.rb b/spec/features/merge_requests/cherry_pick_spec.rb index 5a5f884c6b3579622e94b2bb7e8a7925df139d2f..e4c33d57e8d363c11df634eeab208fecc4075943 100644 --- a/spec/features/merge_requests/cherry_pick_spec.rb +++ b/spec/features/merge_requests/cherry_pick_spec.rb @@ -7,7 +7,7 @@ describe 'Cherry-pick Merge Requests', js: true do let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user) } before do - gitlab_sign_in user + sign_in user project.team << [user, :master] end diff --git a/spec/features/merge_requests/closes_issues_spec.rb b/spec/features/merge_requests/closes_issues_spec.rb index 2f639b54637a57261acc0ccf2b9bd67ad42303b7..527837b56beb61e1c8181e2e0227fdaaa4f31e60 100644 --- a/spec/features/merge_requests/closes_issues_spec.rb +++ b/spec/features/merge_requests/closes_issues_spec.rb @@ -20,7 +20,7 @@ feature 'Merge Request closing issues message', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_merge_request_path(project, merge_request) wait_for_requests diff --git a/spec/features/merge_requests/conflicts_spec.rb b/spec/features/merge_requests/conflicts_spec.rb index a9947381f46e6e1891b3ae713ce11ab8c24de6e8..3e01ea691221df8f89dc41e472ef38edf14f219a 100644 --- a/spec/features/merge_requests/conflicts_spec.rb +++ b/spec/features/merge_requests/conflicts_spec.rb @@ -79,7 +79,7 @@ feature 'Merge request conflict resolution', js: true, feature: true do context 'can be resolved in the UI' do before do project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) end context 'the conflicts are resolvable' do @@ -164,7 +164,7 @@ feature 'Merge request conflict resolution', js: true, feature: true do before do project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) visit project_merge_request_path(project, merge_request) end diff --git a/spec/features/merge_requests/create_new_mr_spec.rb b/spec/features/merge_requests/create_new_mr_spec.rb index 198fcba4e78db444964c056e0c41582d564eb1c7..e0d97dec58649f5bead516209257127fc7c489d6 100644 --- a/spec/features/merge_requests/create_new_mr_spec.rb +++ b/spec/features/merge_requests/create_new_mr_spec.rb @@ -7,7 +7,7 @@ feature 'Create New Merge Request', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user end it 'selects the source branch sha when a tag with the same name exists' do diff --git a/spec/features/merge_requests/created_from_fork_spec.rb b/spec/features/merge_requests/created_from_fork_spec.rb index 9f1b6be67d4062849c2b465d1aa2c0c3ee760569..9b7795ace621a7a6404df6833222dc86860143e6 100644 --- a/spec/features/merge_requests/created_from_fork_spec.rb +++ b/spec/features/merge_requests/created_from_fork_spec.rb @@ -16,7 +16,7 @@ feature 'Merge request created from fork' do background do fork_project.team << [user, :master] - gitlab_sign_in user + sign_in user end scenario 'user can access merge request' do diff --git a/spec/features/merge_requests/deleted_source_branch_spec.rb b/spec/features/merge_requests/deleted_source_branch_spec.rb index 671c17cd9e335aae6ffaec74126dde96cdddd6c6..8d7160e2df2bc93c719c2e9c2d2255c43c3b6de0 100644 --- a/spec/features/merge_requests/deleted_source_branch_spec.rb +++ b/spec/features/merge_requests/deleted_source_branch_spec.rb @@ -8,7 +8,7 @@ describe 'Deleted source branch', feature: true, js: true do let(:merge_request) { create(:merge_request) } before do - gitlab_sign_in user + sign_in user merge_request.project.team << [user, :master] merge_request.update!(source_branch: 'this-branch-does-not-exist') visit project_merge_request_path(merge_request.project, merge_request) diff --git a/spec/features/merge_requests/diff_notes_avatars_spec.rb b/spec/features/merge_requests/diff_notes_avatars_spec.rb index 1b45bb7386390425ba4d30c0648990e1b4afac99..4fc700271935cbfd905bdaf619dba04156c02d7f 100644 --- a/spec/features/merge_requests/diff_notes_avatars_spec.rb +++ b/spec/features/merge_requests/diff_notes_avatars_spec.rb @@ -20,7 +20,7 @@ feature 'Diff note avatars', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user end context 'discussion tab' do diff --git a/spec/features/merge_requests/diff_notes_resolve_spec.rb b/spec/features/merge_requests/diff_notes_resolve_spec.rb index 21dce18508555ccae20872cf0452ea31e199ce5e..93e2d134389fc48535b55337fbb8db50923f0be4 100644 --- a/spec/features/merge_requests/diff_notes_resolve_spec.rb +++ b/spec/features/merge_requests/diff_notes_resolve_spec.rb @@ -19,7 +19,7 @@ feature 'Diff notes resolve', feature: true, js: true do context 'no discussions' do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user note.destroy visit_merge_request end @@ -33,7 +33,7 @@ feature 'Diff notes resolve', feature: true, js: true do context 'as authorized user' do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user visit_merge_request end @@ -402,7 +402,7 @@ feature 'Diff notes resolve', feature: true, js: true do before do project.team << [guest, :guest] - gitlab_sign_in guest + sign_in guest end context 'someone elses merge request' do diff --git a/spec/features/merge_requests/diffs_spec.rb b/spec/features/merge_requests/diffs_spec.rb index 35976b615ade0fe4e514063a2baf860eb53be458..d9de4e388d5f5d56ff26328ea5458733ad749e0c 100644 --- a/spec/features/merge_requests/diffs_spec.rb +++ b/spec/features/merge_requests/diffs_spec.rb @@ -74,7 +74,7 @@ feature 'Diffs URL', js: true, feature: true do context 'as author' do it 'shows direct edit link' do - gitlab_sign_in(author_user) + sign_in(author_user) visit diffs_project_merge_request_path(project, merge_request) # Throws `Capybara::Poltergeist::InvalidSelector` if we try to use `#hash` syntax @@ -84,7 +84,7 @@ feature 'Diffs URL', js: true, feature: true do context 'as user who needs to fork' do it 'shows fork/cancel confirmation' do - gitlab_sign_in(user) + sign_in(user) visit diffs_project_merge_request_path(project, merge_request) # Throws `Capybara::Poltergeist::InvalidSelector` if we try to use `#hash` syntax diff --git a/spec/features/merge_requests/discussion_spec.rb b/spec/features/merge_requests/discussion_spec.rb index a50f66cfc6439216a34fa0316e08e35ed3757760..55846f8609b8d5ef35cf11136e7afc95ac013205 100644 --- a/spec/features/merge_requests/discussion_spec.rb +++ b/spec/features/merge_requests/discussion_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Merge Request Discussions', feature: true do before do - gitlab_sign_in :admin + sign_in(create(:admin)) end describe "Diff discussions" do diff --git a/spec/features/merge_requests/edit_mr_spec.rb b/spec/features/merge_requests/edit_mr_spec.rb index 8ee78526232ed3f438f551cc93ec6def5f34d1df..b7063f35546ac7126eea03b95211b141a43af505 100644 --- a/spec/features/merge_requests/edit_mr_spec.rb +++ b/spec/features/merge_requests/edit_mr_spec.rb @@ -8,7 +8,7 @@ feature 'Edit Merge Request', feature: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user visit edit_project_merge_request_path(project, merge_request) end diff --git a/spec/features/merge_requests/filter_by_labels_spec.rb b/spec/features/merge_requests/filter_by_labels_spec.rb index e3d48128aeb9879e8546cb3b76589adcc67f8d14..754f82900e4cdb6198d942bf4a3d6eddb9a87420 100644 --- a/spec/features/merge_requests/filter_by_labels_spec.rb +++ b/spec/features/merge_requests/filter_by_labels_spec.rb @@ -26,7 +26,7 @@ feature 'Issue filtering by Labels', feature: true, js: true do mr3.labels << feature project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_merge_requests_path(project) end diff --git a/spec/features/merge_requests/filter_by_milestone_spec.rb b/spec/features/merge_requests/filter_by_milestone_spec.rb index 79bca0c9de2523c7be591910bde9ea09a68d434d..d2af150d852d2f63dae730d511eb0af3be5cc370 100644 --- a/spec/features/merge_requests/filter_by_milestone_spec.rb +++ b/spec/features/merge_requests/filter_by_milestone_spec.rb @@ -15,7 +15,7 @@ feature 'Merge Request filtering by Milestone', feature: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end scenario 'filters by no Milestone', js: true do diff --git a/spec/features/merge_requests/filter_merge_requests_spec.rb b/spec/features/merge_requests/filter_merge_requests_spec.rb index 2a62cda6d84437484c4ba624a2d86ffc0e18d3dc..2a161b83aa08128a41f6fc00bdb77f0e9adef075 100644 --- a/spec/features/merge_requests/filter_merge_requests_spec.rb +++ b/spec/features/merge_requests/filter_merge_requests_spec.rb @@ -14,7 +14,7 @@ describe 'Filter merge requests', feature: true do before do project.team << [user, :master] group.add_developer(user) - gitlab_sign_in(user) + sign_in(user) create(:merge_request, source_project: project, target_project: project) visit project_merge_requests_path(project) diff --git a/spec/features/merge_requests/form_spec.rb b/spec/features/merge_requests/form_spec.rb index 8f2857c66f7ccfb4791db0a7a7ef2cab48bb254c..171386e16ad598e4d46742b6496cb687a9fd7aac 100644 --- a/spec/features/merge_requests/form_spec.rb +++ b/spec/features/merge_requests/form_spec.rb @@ -16,7 +16,7 @@ describe 'New/edit merge request', feature: true, js: true do context 'owned projects' do before do - gitlab_sign_in(user) + sign_in(user) end context 'new merge request' do @@ -174,7 +174,7 @@ describe 'New/edit merge request', feature: true, js: true do context 'forked project' do before do fork_project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'new merge request' do diff --git a/spec/features/merge_requests/merge_commit_message_toggle_spec.rb b/spec/features/merge_requests/merge_commit_message_toggle_spec.rb index 831c60625f45a197e796c5272857dcef0d83d2b9..6cd62ecec722503b342c19cd1da9dda5d824ad2c 100644 --- a/spec/features/merge_requests/merge_commit_message_toggle_spec.rb +++ b/spec/features/merge_requests/merge_commit_message_toggle_spec.rb @@ -34,7 +34,7 @@ feature 'Clicking toggle commit message link', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_merge_request_path(project, merge_request) diff --git a/spec/features/merge_requests/merge_immediately_with_pipeline_spec.rb b/spec/features/merge_requests/merge_immediately_with_pipeline_spec.rb index 716f829295ea5e77f24c667cdf03fc8431456074..d3475bee5ccda0cae0bf61547e8ba5ae3c7fc254 100644 --- a/spec/features/merge_requests/merge_immediately_with_pipeline_spec.rb +++ b/spec/features/merge_requests/merge_immediately_with_pipeline_spec.rb @@ -28,7 +28,7 @@ feature 'Merge immediately', :feature, :js do end before do - gitlab_sign_in user + sign_in user visit project_merge_request_path(merge_request.project, merge_request) end diff --git a/spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb b/spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb index 2a4178a819b7b89744f38aa6fcb0aa22c0f93e54..230b04296b35c2ebb9d4482d494dab7fc6b1b4f0 100644 --- a/spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb +++ b/spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb @@ -28,7 +28,7 @@ feature 'Merge When Pipeline Succeeds', :feature, :js do end before do - gitlab_sign_in user + sign_in user visit_merge_request(merge_request) end @@ -121,7 +121,7 @@ feature 'Merge When Pipeline Succeeds', :feature, :js do end before do - gitlab_sign_in user + sign_in user visit_merge_request(merge_request) end diff --git a/spec/features/merge_requests/mini_pipeline_graph_spec.rb b/spec/features/merge_requests/mini_pipeline_graph_spec.rb index 2c0632a4e8292be669f9d29d1bb6eb1b418b14c5..4adf72a60b0d2495c797de0c78862753199e9b29 100644 --- a/spec/features/merge_requests/mini_pipeline_graph_spec.rb +++ b/spec/features/merge_requests/mini_pipeline_graph_spec.rb @@ -11,7 +11,7 @@ feature 'Mini Pipeline Graph', :js, :feature do before do build.run - gitlab_sign_in(user) + sign_in(user) visit_merge_request end diff --git a/spec/features/merge_requests/only_allow_merge_if_build_succeeds_spec.rb b/spec/features/merge_requests/only_allow_merge_if_build_succeeds_spec.rb index 6bcfef71d253dba4e7443b140a0f230dd4279350..651cb9d86fb25098b9ece542270a59743e0a8960 100644 --- a/spec/features/merge_requests/only_allow_merge_if_build_succeeds_spec.rb +++ b/spec/features/merge_requests/only_allow_merge_if_build_succeeds_spec.rb @@ -5,7 +5,7 @@ feature 'Only allow merge requests to be merged if the pipeline succeeds', featu let(:project) { merge_request.target_project } before do - gitlab_sign_in merge_request.author + sign_in merge_request.author project.team << [merge_request.author, :master] end diff --git a/spec/features/merge_requests/pipelines_spec.rb b/spec/features/merge_requests/pipelines_spec.rb index d55e6329a9fbe612e2d9df06d036f731e958e07b..837366ced3cffaaf94ac13736bf3afa01cf93fcc 100644 --- a/spec/features/merge_requests/pipelines_spec.rb +++ b/spec/features/merge_requests/pipelines_spec.rb @@ -7,7 +7,7 @@ feature 'Pipelines for Merge Requests', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user end context 'with pipelines' do diff --git a/spec/features/merge_requests/target_branch_spec.rb b/spec/features/merge_requests/target_branch_spec.rb index c61f817dd9aae9e52ef378a4a36aee43b6b98ea0..3ed76926eab4716080e96e520db34317a27317f4 100644 --- a/spec/features/merge_requests/target_branch_spec.rb +++ b/spec/features/merge_requests/target_branch_spec.rb @@ -10,7 +10,7 @@ describe 'Target branch', feature: true, js: true do end before do - gitlab_sign_in user + sign_in user project.team << [user, :master] end diff --git a/spec/features/merge_requests/toggle_whitespace_changes_spec.rb b/spec/features/merge_requests/toggle_whitespace_changes_spec.rb index ae7e99d14628362f405f8cf69e67094017fc1dba..912aa34b0c8975de6e8fde67f21c3281869e4133 100644 --- a/spec/features/merge_requests/toggle_whitespace_changes_spec.rb +++ b/spec/features/merge_requests/toggle_whitespace_changes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Toggle Whitespace Changes', js: true, feature: true do before do - gitlab_sign_in :admin + sign_in(create(:admin)) merge_request = create(:merge_request) project = merge_request.source_project visit diffs_project_merge_request_path(project, merge_request) diff --git a/spec/features/merge_requests/toggler_behavior_spec.rb b/spec/features/merge_requests/toggler_behavior_spec.rb index 219b9fd893823ce6da92b1b2f3984ce198769f65..01251105f723016c18f7a4d6584348fb97b5efe4 100644 --- a/spec/features/merge_requests/toggler_behavior_spec.rb +++ b/spec/features/merge_requests/toggler_behavior_spec.rb @@ -8,7 +8,7 @@ feature 'toggler_behavior', js: true, feature: true do let(:fragment_id) { "#note_#{note.id}" } before do - gitlab_sign_in :admin + sign_in(create(:admin)) project = merge_request.source_project page.current_window.resize_to(1000, 300) visit "#{project_merge_request_path(project, merge_request)}#{fragment_id}" diff --git a/spec/features/merge_requests/update_merge_requests_spec.rb b/spec/features/merge_requests/update_merge_requests_spec.rb index f8f3e37719818fe2dc2fa8f517c907b1821736b2..43153e2cfa4b0de221a4774c640c2eecf2efe376 100644 --- a/spec/features/merge_requests/update_merge_requests_spec.rb +++ b/spec/features/merge_requests/update_merge_requests_spec.rb @@ -7,7 +7,7 @@ feature 'Multiple merge requests updating from merge_requests#index', feature: t before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'status', js: true do diff --git a/spec/features/merge_requests/user_posts_diff_notes_spec.rb b/spec/features/merge_requests/user_posts_diff_notes_spec.rb index 7b1ac60231adf349882ea8b840564852aa909775..1cfd78663e5d32faf84f18cb641dbb45ed456ccf 100644 --- a/spec/features/merge_requests/user_posts_diff_notes_spec.rb +++ b/spec/features/merge_requests/user_posts_diff_notes_spec.rb @@ -7,7 +7,7 @@ feature 'Merge requests > User posts diff notes', :js do before do project.add_developer(user) - gitlab_sign_in(user) + sign_in(user) end let(:comment_button_class) { '.add-diff-note' } diff --git a/spec/features/merge_requests/user_posts_notes_spec.rb b/spec/features/merge_requests/user_posts_notes_spec.rb index b3c8b0e9c346506e53355bf38775ced2e75886de..35ed08e0a5ee2120fe82526fd46adf1319ad68dd 100644 --- a/spec/features/merge_requests/user_posts_notes_spec.rb +++ b/spec/features/merge_requests/user_posts_notes_spec.rb @@ -13,7 +13,7 @@ describe 'Merge requests > User posts notes', :js do end before do - gitlab_sign_in :admin + sign_in(create(:admin)) visit project_merge_request_path(project, merge_request) end diff --git a/spec/features/merge_requests/user_sees_system_notes_spec.rb b/spec/features/merge_requests/user_sees_system_notes_spec.rb index 385708a28c5ee30e9bb81cc8c92cd044c1ff008a..624a425ae521f0dab68ae876ddd2c7fe8ddcd543 100644 --- a/spec/features/merge_requests/user_sees_system_notes_spec.rb +++ b/spec/features/merge_requests/user_sees_system_notes_spec.rb @@ -11,7 +11,7 @@ feature 'Merge requests > User sees system notes' do before do user = create(:user) private_project.add_developer(user) - gitlab_sign_in(user) + sign_in(user) end it 'shows the system note' do diff --git a/spec/features/merge_requests/user_uses_slash_commands_spec.rb b/spec/features/merge_requests/user_uses_slash_commands_spec.rb index 229dcda7ce42786dd600b7581a3dd5261032abde..434f5a7c0acbdc5034fa43ebfb87ac7ee3476aa9 100644 --- a/spec/features/merge_requests/user_uses_slash_commands_spec.rb +++ b/spec/features/merge_requests/user_uses_slash_commands_spec.rb @@ -16,7 +16,7 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do describe 'merge-request-only commands' do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_merge_request_path(project, merge_request) end @@ -51,8 +51,8 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do let(:guest) { create(:user) } before do project.team << [guest, :guest] - gitlab_sign_out - gitlab_sign_in(guest) + sign_out(:user) + sign_in(guest) visit project_merge_request_path(project, merge_request) end @@ -97,8 +97,8 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do let(:guest) { create(:user) } before do project.team << [guest, :guest] - gitlab_sign_out - gitlab_sign_in(guest) + sign_out(:user) + sign_in(guest) visit project_merge_request_path(project, merge_request) end @@ -125,9 +125,9 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do let(:new_url_opts) { { merge_request: { source_branch: 'feature' } } } before do - gitlab_sign_out + sign_out(:user) another_project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end it 'changes target_branch in new merge_request' do @@ -181,8 +181,8 @@ feature 'Merge Requests > User uses quick actions', feature: true, js: true do let(:guest) { create(:user) } before do project.team << [guest, :guest] - gitlab_sign_out - gitlab_sign_in(guest) + sign_out(:user) + sign_in(guest) visit project_merge_request_path(project, merge_request) end diff --git a/spec/features/merge_requests/versions_spec.rb b/spec/features/merge_requests/versions_spec.rb index 94fcfa398c9e92aab12fd9e3db48cd207ba32f59..218d57b49e3cced293531380fa83ef63b3e9a5cf 100644 --- a/spec/features/merge_requests/versions_spec.rb +++ b/spec/features/merge_requests/versions_spec.rb @@ -8,7 +8,7 @@ feature 'Merge Request versions', js: true, feature: true do let!(:merge_request_diff3) { merge_request.merge_request_diffs.create(head_commit_sha: '5937ac0a7beb003549fc5fd26fc247adbce4a52e') } before do - gitlab_sign_in :admin + sign_in(create(:admin)) visit diffs_project_merge_request_path(project, merge_request) end diff --git a/spec/features/merge_requests/widget_deployments_spec.rb b/spec/features/merge_requests/widget_deployments_spec.rb index c43c7460a08b2a545be09740c816e9a0602547c5..b0fe5f3e1cbdc4c6b384a6473b037761a1a8ec81 100644 --- a/spec/features/merge_requests/widget_deployments_spec.rb +++ b/spec/features/merge_requests/widget_deployments_spec.rb @@ -12,7 +12,7 @@ feature 'Widget Deployments Header', feature: true, js: true do given!(:manual) { } background do - gitlab_sign_in(user) + sign_in(user) project.team << [user, role] visit project_merge_request_path(project, merge_request) end diff --git a/spec/features/merge_requests/widget_spec.rb b/spec/features/merge_requests/widget_spec.rb index 8135411fe033ef0b12a12dca168ddf292e247961..46c558659c7676f53df2f1b26174eb2a2d14fee1 100644 --- a/spec/features/merge_requests/widget_spec.rb +++ b/spec/features/merge_requests/widget_spec.rb @@ -7,7 +7,7 @@ describe 'Merge request', :feature, :js do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'new merge request' do @@ -19,8 +19,7 @@ describe 'Merge request', :feature, :js do target_project_id: project.id, source_branch: 'feature', target_branch: 'master' - } - ) + }) end it 'shows widget status after creating new merge request' do @@ -206,8 +205,8 @@ describe 'Merge request', :feature, :js do before do project.team << [user2, :master] - gitlab_sign_out - gitlab_sign_in user2 + sign_out(:user) + sign_in(user2) merge_request.update(target_project: fork_project) visit project_merge_request_path(project, merge_request) end diff --git a/spec/features/merge_requests/wip_message_spec.rb b/spec/features/merge_requests/wip_message_spec.rb index 224723773bf66d136434435e240192bc19db26c6..91cf8fc721818b4105561771cfcc70eb20ff467d 100644 --- a/spec/features/merge_requests/wip_message_spec.rb +++ b/spec/features/merge_requests/wip_message_spec.rb @@ -6,7 +6,7 @@ feature 'Work In Progress help message', feature: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'with WIP commits' do @@ -18,8 +18,7 @@ feature 'Work In Progress help message', feature: true do target_project_id: project.id, source_branch: 'wip', target_branch: 'master' - } - ) + }) within_wip_explanation do expect(page).to have_text( @@ -38,8 +37,7 @@ feature 'Work In Progress help message', feature: true do target_project_id: project.id, source_branch: 'fix', target_branch: 'master' - } - ) + }) within_wip_explanation do expect(page).not_to have_text( diff --git a/spec/features/milestone_spec.rb b/spec/features/milestone_spec.rb index 2afdd0d321c78fabce27804908099aac0109b0d5..ce0c27cbe772f602303d412c0a422bbe4acef6b2 100644 --- a/spec/features/milestone_spec.rb +++ b/spec/features/milestone_spec.rb @@ -8,7 +8,7 @@ feature 'Milestone', feature: true do before do create(:group_member, group: group, user: user) project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end feature 'Create a milestone' do diff --git a/spec/features/milestones/show_spec.rb b/spec/features/milestones/show_spec.rb index fc7d2f9662dba87b58c07e2c69629c5586f0f55d..626a1f35e62c4cd0824e10a58f574b33810c0cd5 100644 --- a/spec/features/milestones/show_spec.rb +++ b/spec/features/milestones/show_spec.rb @@ -9,7 +9,7 @@ describe 'Milestone show', feature: true do before do project.add_user(user, :developer) - gitlab_sign_in(user) + sign_in(user) end def visit_milestone diff --git a/spec/features/participants_autocomplete_spec.rb b/spec/features/participants_autocomplete_spec.rb index a66d0f4abad193c6052390d40fa21ceb17a64ad0..382d83ca051d2b96f340364eb8e83004fefe4d0d 100644 --- a/spec/features/participants_autocomplete_spec.rb +++ b/spec/features/participants_autocomplete_spec.rb @@ -8,7 +8,7 @@ feature 'Member autocomplete', :js do before do note # actually create the note - gitlab_sign_in(user) + sign_in(user) end shared_examples "open suggestions when typing @" do diff --git a/spec/features/profile_spec.rb b/spec/features/profile_spec.rb index bb4263d83f37aef54053bc41230a5aab280e947f..fae11a993b55a592f67407470e8f260909ffefc8 100644 --- a/spec/features/profile_spec.rb +++ b/spec/features/profile_spec.rb @@ -4,7 +4,7 @@ describe 'Profile account page', feature: true do let(:user) { create(:user) } before do - gitlab_sign_in(user) + sign_in(user) end describe 'when signup is enabled' do diff --git a/spec/features/profiles/account_spec.rb b/spec/features/profiles/account_spec.rb index 33fd29b429b59434d78d45ab1af2ed446d088788..9d782ecf63ba20f430c2377ec210ac79131062d4 100644 --- a/spec/features/profiles/account_spec.rb +++ b/spec/features/profiles/account_spec.rb @@ -4,7 +4,7 @@ feature 'Profile > Account', feature: true do given(:user) { create(:user, username: 'foo') } before do - gitlab_sign_in(user) + sign_in(user) end describe 'Change username' do diff --git a/spec/features/profiles/chat_names_spec.rb b/spec/features/profiles/chat_names_spec.rb index 1a162d6be0e3cd2a48eecdab45e9011518614961..e4c236f4c684e6489bb0284774ad6ae7d27df492 100644 --- a/spec/features/profiles/chat_names_spec.rb +++ b/spec/features/profiles/chat_names_spec.rb @@ -5,7 +5,7 @@ feature 'Profile > Chat', feature: true do given(:service) { create(:service) } before do - gitlab_sign_in(user) + sign_in(user) end describe 'uses authorization link' do diff --git a/spec/features/profiles/keys_spec.rb b/spec/features/profiles/keys_spec.rb index 13f9afd4ce028d1d963e01716993059a2e5f3fc5..9439a258a75771be559a6d96ca2f600e6392c27b 100644 --- a/spec/features/profiles/keys_spec.rb +++ b/spec/features/profiles/keys_spec.rb @@ -4,7 +4,7 @@ feature 'Profile > SSH Keys', feature: true do let(:user) { create(:user) } before do - gitlab_sign_in(user) + sign_in(user) end describe 'User adds a key' do diff --git a/spec/features/profiles/oauth_applications_spec.rb b/spec/features/profiles/oauth_applications_spec.rb index a6f9beafe174e570a05369d05aa1582e19c862c9..c7886421c83d08e264ccd2a4ff10dac8fd6d5c29 100644 --- a/spec/features/profiles/oauth_applications_spec.rb +++ b/spec/features/profiles/oauth_applications_spec.rb @@ -4,7 +4,7 @@ describe 'Profile > Applications', feature: true do let(:user) { create(:user) } before do - gitlab_sign_in(user) + sign_in(user) end describe 'User manages applications', js: true do diff --git a/spec/features/profiles/password_spec.rb b/spec/features/profiles/password_spec.rb index 86c9df5ff86e77a2852b70e128424fcec9efceee..67975a68ee2a39736e39fd1798319904ac3766ea 100644 --- a/spec/features/profiles/password_spec.rb +++ b/spec/features/profiles/password_spec.rb @@ -4,7 +4,7 @@ describe 'Profile > Password', feature: true do let(:user) { create(:user, password_automatically_set: true) } before do - gitlab_sign_in(user) + sign_in(user) visit edit_profile_password_path end diff --git a/spec/features/profiles/personal_access_tokens_spec.rb b/spec/features/profiles/personal_access_tokens_spec.rb index d7acaaf1eb85c0d4ca5649850b17d710ebb4b77b..44b7ee101c97bb775123cfb095c6da77c3d7ea61 100644 --- a/spec/features/profiles/personal_access_tokens_spec.rb +++ b/spec/features/profiles/personal_access_tokens_spec.rb @@ -23,7 +23,7 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do end before do - gitlab_sign_in(user) + sign_in(user) end describe "token creation" do diff --git a/spec/features/profiles/preferences_spec.rb b/spec/features/profiles/preferences_spec.rb index 8e7ef6bc1101b9d0bf872b2eb8d1d0f72657c825..65fed82c256b4b2ad834846ffda05a8535d69b32 100644 --- a/spec/features/profiles/preferences_spec.rb +++ b/spec/features/profiles/preferences_spec.rb @@ -4,7 +4,7 @@ describe 'Profile > Preferences', feature: true do let(:user) { create(:user) } before do - gitlab_sign_in(user) + sign_in(user) visit profile_preferences_path end diff --git a/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb b/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb index c0092836e3ba10a8e5639157ca15740f28f90213..75daef0c38c2d3203ca991e77aa05176bc986f3b 100644 --- a/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb +++ b/spec/features/profiles/user_changes_notified_of_own_activity_spec.rb @@ -4,7 +4,7 @@ feature 'Profile > Notifications > User changes notified_of_own_activity setting let(:user) { create(:user) } before do - gitlab_sign_in(user) + sign_in(user) end scenario 'User opts into receiving notifications about their own activity' do diff --git a/spec/features/projects/activity/rss_spec.rb b/spec/features/projects/activity/rss_spec.rb index 97925bc2ebf043789be77c32b6822e570962a1e4..b054f543dc6e88b49dcc4e23e707e45973db8b3f 100644 --- a/spec/features/projects/activity/rss_spec.rb +++ b/spec/features/projects/activity/rss_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' feature 'Project Activity RSS' do + let(:user) { create(:user) } let(:project) { create(:empty_project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let(:path) { activity_project_path(project) } @@ -10,9 +11,8 @@ feature 'Project Activity RSS' do context 'when signed in' do before do - user = create(:user) project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) visit path end diff --git a/spec/features/projects/badges/coverage_spec.rb b/spec/features/projects/badges/coverage_spec.rb index efadb6400962f1a4e5e7e0008e36e4b9c0953253..5c5a7c967636c71a996a5dcb7e7071dc8751de55 100644 --- a/spec/features/projects/badges/coverage_spec.rb +++ b/spec/features/projects/badges/coverage_spec.rb @@ -7,7 +7,7 @@ feature 'test coverage badge' do context 'when user has access to view badge' do background do project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) end scenario 'user requests coverage badge image for pipeline' do @@ -45,7 +45,7 @@ feature 'test coverage badge' do end context 'when user does not have access to view badge' do - background { gitlab_sign_in(user) } + background { sign_in(user) } scenario 'user requests test coverage badge image' do show_test_coverage_badge diff --git a/spec/features/projects/badges/list_spec.rb b/spec/features/projects/badges/list_spec.rb index cbd44c49d04c399a1fcfbcf07d77517eaff0be89..161d731f524489ad1ee655a84129bce81659f652 100644 --- a/spec/features/projects/badges/list_spec.rb +++ b/spec/features/projects/badges/list_spec.rb @@ -5,7 +5,7 @@ feature 'list of badges' do user = create(:user) project = create(:project) project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_pipelines_settings_path(project) end diff --git a/spec/features/projects/blobs/edit_spec.rb b/spec/features/projects/blobs/edit_spec.rb index c4e53293be0bfdcaac8cb892a3ebda43d98c5727..c9384a09ccd6e01947a38123d0868c8903e43ceb 100644 --- a/spec/features/projects/blobs/edit_spec.rb +++ b/spec/features/projects/blobs/edit_spec.rb @@ -14,7 +14,7 @@ feature 'Editing file blob', feature: true, js: true do before do project.team << [user, role] - gitlab_sign_in(user) + sign_in(user) end def edit_and_commit @@ -92,7 +92,7 @@ feature 'Editing file blob', feature: true, js: true do project.team << [user, :developer] project.repository.add_branch(user, protected_branch, 'master') create(:protected_branch, project: project, name: protected_branch) - gitlab_sign_in(user) + sign_in(user) end context 'on some branch' do @@ -122,7 +122,7 @@ feature 'Editing file blob', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_edit_blob_path(project, tree_join(branch, file_path)) end diff --git a/spec/features/projects/branches/download_buttons_spec.rb b/spec/features/projects/branches/download_buttons_spec.rb index 52323c21112afeedcacb1df68ccb0eda5b5463e2..f01860cc43490615416fb25429570df22be44aa3 100644 --- a/spec/features/projects/branches/download_buttons_spec.rb +++ b/spec/features/projects/branches/download_buttons_spec.rb @@ -22,7 +22,7 @@ feature 'Download buttons in branches page', feature: true do end background do - gitlab_sign_in(user) + sign_in(user) project.team << [user, role] end diff --git a/spec/features/projects/branches/new_branch_ref_dropdown_spec.rb b/spec/features/projects/branches/new_branch_ref_dropdown_spec.rb index ab9af8fa603d7fbcd4995f694588b3bde2c83a84..8c35dac0b3d2cff6b45bf9090bd47e111d2db691 100644 --- a/spec/features/projects/branches/new_branch_ref_dropdown_spec.rb +++ b/spec/features/projects/branches/new_branch_ref_dropdown_spec.rb @@ -8,7 +8,7 @@ describe 'New Branch Ref Dropdown', :js, :feature do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) visit new_project_branch_path(project) end diff --git a/spec/features/projects/commit/builds_spec.rb b/spec/features/projects/commit/builds_spec.rb index 69eeb8e285e76205f9625366cca060c696484f70..257a7418f162d377dcdcf4dedced00838ffbf968 100644 --- a/spec/features/projects/commit/builds_spec.rb +++ b/spec/features/projects/commit/builds_spec.rb @@ -6,7 +6,7 @@ feature 'project commit pipelines', js: true do background do user = create(:user) project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'when no builds triggered yet' do diff --git a/spec/features/projects/commit/mini_pipeline_graph_spec.rb b/spec/features/projects/commit/mini_pipeline_graph_spec.rb index c8222326e919c42ae67c40fa933b4f02090f5b2e..a5736b6072a33e1c41bef7bf00a1de377a499dbd 100644 --- a/spec/features/projects/commit/mini_pipeline_graph_spec.rb +++ b/spec/features/projects/commit/mini_pipeline_graph_spec.rb @@ -5,7 +5,7 @@ feature 'Mini Pipeline Graph in Commit View', :js, :feature do let(:project) { create(:project, :public) } before do - gitlab_sign_in(user) + sign_in(user) end context 'when commit has pipelines' do diff --git a/spec/features/projects/commit/rss_spec.rb b/spec/features/projects/commit/rss_spec.rb index 152c0d7c8de0c0632f1ea71916d8da5256b3bef0..db958346f06612669e09eb0cf16e07726fb045f2 100644 --- a/spec/features/projects/commit/rss_spec.rb +++ b/spec/features/projects/commit/rss_spec.rb @@ -1,14 +1,14 @@ require 'spec_helper' feature 'Project Commits RSS' do + let(:user) { create(:user) } let(:project) { create(:project, :repository, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let(:path) { project_commits_path(project, :master) } context 'when signed in' do before do - user = create(:user) project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) visit path end diff --git a/spec/features/projects/compare_spec.rb b/spec/features/projects/compare_spec.rb index c3adfa87c444aa5806fffc1ef8858e7f07549475..0f48751fa10843c852a22a12f9cc439a02dcf9e8 100644 --- a/spec/features/projects/compare_spec.rb +++ b/spec/features/projects/compare_spec.rb @@ -6,7 +6,7 @@ describe "Compare", js: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_compare_index_path(project, from: "master", to: "master") end diff --git a/spec/features/projects/deploy_keys_spec.rb b/spec/features/projects/deploy_keys_spec.rb index a310d14be1037015bddecd6f72a2dfaa2d2915d6..cf3e1ff451ef4044a764e52dc4c4eb96a18bce95 100644 --- a/spec/features/projects/deploy_keys_spec.rb +++ b/spec/features/projects/deploy_keys_spec.rb @@ -6,7 +6,7 @@ describe 'Project deploy keys', :js, :feature do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end describe 'removing key' do diff --git a/spec/features/projects/developer_views_empty_project_instructions_spec.rb b/spec/features/projects/developer_views_empty_project_instructions_spec.rb index 290dc1a2f79091340ab85f02b9a94974fc47f496..1b0d13e07db855c2de43af00db2be959a86a2661 100644 --- a/spec/features/projects/developer_views_empty_project_instructions_spec.rb +++ b/spec/features/projects/developer_views_empty_project_instructions_spec.rb @@ -7,7 +7,7 @@ feature 'Developer views empty project instructions', feature: true do background do project.team << [developer, :developer] - gitlab_sign_in(developer) + sign_in(developer) end context 'without an SSH key' do diff --git a/spec/features/projects/edit_spec.rb b/spec/features/projects/edit_spec.rb index 78c1a1f1d1ae22e1c92df950086d518e22acdb2b..1fca0dde534b7b9fcaf65c3fb739edf9362d42d4 100644 --- a/spec/features/projects/edit_spec.rb +++ b/spec/features/projects/edit_spec.rb @@ -6,7 +6,7 @@ feature 'Project edit', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit edit_project_path(project) end diff --git a/spec/features/projects/environments/environment_metrics_spec.rb b/spec/features/projects/environments/environment_metrics_spec.rb index 841514ac7070faeaba3fd7b9038c0064a32da487..cf0dfcfb1f3f7b3023d60376407139f32f15f348 100644 --- a/spec/features/projects/environments/environment_metrics_spec.rb +++ b/spec/features/projects/environments/environment_metrics_spec.rb @@ -15,7 +15,7 @@ feature 'Environment > Metrics', :feature do create(:deployment, environment: environment, deployable: build) stub_all_prometheus_requests(environment.slug) - gitlab_sign_in(user) + sign_in(user) visit_environment(environment) end diff --git a/spec/features/projects/environments/environment_spec.rb b/spec/features/projects/environments/environment_spec.rb index e3f40f8e661692fe6cf154120d7e1e0f0baf3d21..c31b816f7fb5b4f562f4d5f1158b672852106725 100644 --- a/spec/features/projects/environments/environment_spec.rb +++ b/spec/features/projects/environments/environment_spec.rb @@ -6,7 +6,7 @@ feature 'Environment', :feature do given(:role) { :developer } background do - gitlab_sign_in(user) + sign_in(user) project.team << [user, role] end diff --git a/spec/features/projects/environments/environments_spec.rb b/spec/features/projects/environments/environments_spec.rb index af3af3eb965b73fd271431cef757d88f17b3722b..99b917cb420a81dd0459f9e83cbded7c865dd2c7 100644 --- a/spec/features/projects/environments/environments_spec.rb +++ b/spec/features/projects/environments/environments_spec.rb @@ -7,7 +7,7 @@ feature 'Environments page', :feature, :js do background do project.team << [user, role] - gitlab_sign_in(user) + sign_in(user) end given!(:environment) { } diff --git a/spec/features/projects/features_visibility_spec.rb b/spec/features/projects/features_visibility_spec.rb index 45b0c8d1a1839bbe47af37b138464623947b4306..827e02a58d0faf34bad59d33159b0fc8104d332b 100644 --- a/spec/features/projects/features_visibility_spec.rb +++ b/spec/features/projects/features_visibility_spec.rb @@ -9,7 +9,7 @@ describe 'Edit Project Settings', feature: true do describe 'project features visibility selectors', js: true do before do project.team << [member, :master] - gitlab_sign_in(member) + sign_in(member) end tools = { builds: "pipelines", issues: "issues", wiki: "wiki", snippets: "snippets", merge_requests: "merge_requests" } @@ -83,7 +83,7 @@ describe 'Edit Project Settings', feature: true do context 'normal user' do before do - gitlab_sign_in(member) + sign_in(member) end it 'renders 200 if tool is enabled' do @@ -130,7 +130,7 @@ describe 'Edit Project Settings', feature: true do context 'admin user' do before do non_member.update_attribute(:admin, true) - gitlab_sign_in(non_member) + sign_in(non_member) end it 'renders 404 if feature is disabled' do @@ -156,7 +156,7 @@ describe 'Edit Project Settings', feature: true do describe 'repository visibility', js: true do before do project.team << [member, :master] - gitlab_sign_in(member) + sign_in(member) visit edit_project_path(project) end @@ -242,7 +242,7 @@ describe 'Edit Project Settings', feature: true do before do project.team << [member, :guest] - gitlab_sign_in(member) + sign_in(member) visit project_path(project) end diff --git a/spec/features/projects/files/browse_files_spec.rb b/spec/features/projects/files/browse_files_spec.rb index ac2b926f4decc59494ef0ce891c5e25db32b51b8..d9a561b23a23db26f75272c733d365d44ab5cbee 100644 --- a/spec/features/projects/files/browse_files_spec.rb +++ b/spec/features/projects/files/browse_files_spec.rb @@ -6,7 +6,7 @@ feature 'user browses project', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_tree_path(project, project.default_branch) end diff --git a/spec/features/projects/files/creating_a_file_spec.rb b/spec/features/projects/files/creating_a_file_spec.rb index 1196994ac3aa99a08acfb0c1be3643c01ace7e4b..55350db4c34ad9159c277689e8851e4370537d19 100644 --- a/spec/features/projects/files/creating_a_file_spec.rb +++ b/spec/features/projects/files/creating_a_file_spec.rb @@ -6,7 +6,7 @@ feature 'User wants to create a file', feature: true do background do project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_new_blob_path(project, project.default_branch) end diff --git a/spec/features/projects/files/dockerfile_dropdown_spec.rb b/spec/features/projects/files/dockerfile_dropdown_spec.rb index 783d98dafa7fb7c8e64f1f3a3010dba7acc17460..0cd0c9addd017ec6c8f52d3456e25fb80ce26f30 100644 --- a/spec/features/projects/files/dockerfile_dropdown_spec.rb +++ b/spec/features/projects/files/dockerfile_dropdown_spec.rb @@ -7,7 +7,7 @@ feature 'User wants to add a Dockerfile file', feature: true do project = create(:project) project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_new_blob_path(project, 'master', file_name: 'Dockerfile') end diff --git a/spec/features/projects/files/download_buttons_spec.rb b/spec/features/projects/files/download_buttons_spec.rb index 4f4fab8a6e5e4d57d2947614c165e80d854e0fb9..a2874483149a141bdc81b2e2f4e8c868ece9e6e8 100644 --- a/spec/features/projects/files/download_buttons_spec.rb +++ b/spec/features/projects/files/download_buttons_spec.rb @@ -22,7 +22,7 @@ feature 'Download buttons in files tree', feature: true do end background do - gitlab_sign_in(user) + sign_in(user) project.team << [user, role] end diff --git a/spec/features/projects/files/edit_file_soft_wrap_spec.rb b/spec/features/projects/files/edit_file_soft_wrap_spec.rb index 83aea070901607dd3b6c018cf3cb50d5e84a4e3c..930e4cf488a6376313f3b57b5ef69c9bd8ec6fe1 100644 --- a/spec/features/projects/files/edit_file_soft_wrap_spec.rb +++ b/spec/features/projects/files/edit_file_soft_wrap_spec.rb @@ -5,7 +5,7 @@ feature 'User uses soft wrap whilst editing file', feature: true, js: true do user = create(:user) project = create(:project) project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_new_blob_path(project, 'master', file_name: 'test_file-name') editor = find('.file-editor.code') editor.click diff --git a/spec/features/projects/files/editing_a_file_spec.rb b/spec/features/projects/files/editing_a_file_spec.rb index c9b0dbd0ffb4b73359942b8384717339a137256d..c295380dfc9005031ab19e423062991f97c31517 100644 --- a/spec/features/projects/files/editing_a_file_spec.rb +++ b/spec/features/projects/files/editing_a_file_spec.rb @@ -17,7 +17,7 @@ feature 'User wants to edit a file', feature: true do background do project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_edit_blob_path(project, File.join(project.default_branch, '.gitignore')) end diff --git a/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb b/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb index 07b4aa80f4b055812de9b5ff35bd2b19e37db54e..9a1eaee08de78daaf29193ed05bd447bb29cf7f6 100644 --- a/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb +++ b/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb @@ -6,7 +6,7 @@ feature 'User views files page', feature: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_tree_path(project, project.repository.root_ref) end diff --git a/spec/features/projects/files/find_file_keyboard_spec.rb b/spec/features/projects/files/find_file_keyboard_spec.rb index 087eef5d4076c81a8c05782a938ab27ac564a464..772f81c8853b23c215c47d0da617e5d4f487de66 100644 --- a/spec/features/projects/files/find_file_keyboard_spec.rb +++ b/spec/features/projects/files/find_file_keyboard_spec.rb @@ -6,7 +6,7 @@ feature 'Find file keyboard shortcuts', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_find_file_path(project, project.repository.root_ref) diff --git a/spec/features/projects/files/find_files_spec.rb b/spec/features/projects/files/find_files_spec.rb index d2ccc9a073232bb30b42dcd6ffb817e66ff6e657..7a99596585f14b2601543e6e2a7978042347c482 100644 --- a/spec/features/projects/files/find_files_spec.rb +++ b/spec/features/projects/files/find_files_spec.rb @@ -5,7 +5,7 @@ feature 'Find files button in the tree header', feature: true do given(:project) { create(:project) } background do - gitlab_sign_in(user) + sign_in(user) project.team << [user, :developer] end diff --git a/spec/features/projects/files/gitignore_dropdown_spec.rb b/spec/features/projects/files/gitignore_dropdown_spec.rb index 23c145d0a1182a1a3268cd17ee92788a594da94f..a3a7b08c01351e6dca40d5573ca0bc9307bd3477 100644 --- a/spec/features/projects/files/gitignore_dropdown_spec.rb +++ b/spec/features/projects/files/gitignore_dropdown_spec.rb @@ -5,7 +5,7 @@ feature 'User wants to add a .gitignore file', feature: true do user = create(:user) project = create(:project) project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_new_blob_path(project, 'master', file_name: '.gitignore') end diff --git a/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb b/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb index 0539b77e3ddea290bf50377e7c860a828918a229..41afe8014d9fc1091734fe1361c55b1cbb318673 100644 --- a/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb +++ b/spec/features/projects/files/gitlab_ci_yml_dropdown_spec.rb @@ -5,7 +5,7 @@ feature 'User wants to add a .gitlab-ci.yml file', feature: true do user = create(:user) project = create(:project) project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_new_blob_path(project, 'master', file_name: '.gitlab-ci.yml') end diff --git a/spec/features/projects/files/project_owner_creates_license_file_spec.rb b/spec/features/projects/files/project_owner_creates_license_file_spec.rb index 3a4ed3d8cf08e8f900751a9e3a2a45107ec0fe3b..57f4a6f1b6f9e1d83ced7933b523bf64648674d2 100644 --- a/spec/features/projects/files/project_owner_creates_license_file_spec.rb +++ b/spec/features/projects/files/project_owner_creates_license_file_spec.rb @@ -7,7 +7,7 @@ feature 'project owner creates a license file', feature: true, js: true do project.repository.delete_file(project_master, 'LICENSE', message: 'Remove LICENSE', branch_name: 'master') project.team << [project_master, :master] - gitlab_sign_in(project_master) + sign_in(project_master) visit project_path(project) end diff --git a/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb b/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb index 77f97826427006d65a860370c7d85c98168a361a..0604ecb8c8beb1944c92b01c03489526b8ad630f 100644 --- a/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb +++ b/spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb @@ -5,7 +5,7 @@ feature 'project owner sees a link to create a license file in empty project', f let(:project) { create(:empty_project) } background do project.team << [project_master, :master] - gitlab_sign_in(project_master) + sign_in(project_master) end scenario 'project master creates a license file from a template' do diff --git a/spec/features/projects/files/template_type_dropdown_spec.rb b/spec/features/projects/files/template_type_dropdown_spec.rb index 53b673538e5e2c46334128c513e25fc5fa98c80b..a084664326960765e271a66d5a84ecec1a23c84a 100644 --- a/spec/features/projects/files/template_type_dropdown_spec.rb +++ b/spec/features/projects/files/template_type_dropdown_spec.rb @@ -6,7 +6,7 @@ feature 'Template type dropdown selector', js: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user end context 'editing a non-matching file' do diff --git a/spec/features/projects/files/undo_template_spec.rb b/spec/features/projects/files/undo_template_spec.rb index e18ff42942ff834b12a7825e2e9b6de4bf37dbdc..d50ddb1f1a9bda7003703730ebd02b504f91534b 100644 --- a/spec/features/projects/files/undo_template_spec.rb +++ b/spec/features/projects/files/undo_template_spec.rb @@ -6,7 +6,7 @@ feature 'Template Undo Button', js: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user end context 'editing a matching file and applying a template' do diff --git a/spec/features/projects/gfm_autocomplete_load_spec.rb b/spec/features/projects/gfm_autocomplete_load_spec.rb index a8661ad4d249c795eaf9ceebb6fb2b09888ed7ec..aa2306069ad9407e505a43952f0c3261f25550cf 100644 --- a/spec/features/projects/gfm_autocomplete_load_spec.rb +++ b/spec/features/projects/gfm_autocomplete_load_spec.rb @@ -4,7 +4,7 @@ describe 'GFM autocomplete loading', feature: true, js: true do let(:project) { create(:project) } before do - gitlab_sign_in :admin + sign_in(create(:admin)) visit project_path(project) end diff --git a/spec/features/projects/group_links_spec.rb b/spec/features/projects/group_links_spec.rb index 64415ffe57f3276e72d71b142ecfdef31120f5eb..631955a60a119935c726374fa2e635118922b3a0 100644 --- a/spec/features/projects/group_links_spec.rb +++ b/spec/features/projects/group_links_spec.rb @@ -9,7 +9,7 @@ feature 'Project group links', :feature, :js do background do project.add_master(master) - gitlab_sign_in(master) + sign_in(master) end context 'setting an expiration date for a group link' do diff --git a/spec/features/projects/guest_navigation_menu_spec.rb b/spec/features/projects/guest_navigation_menu_spec.rb index f6e24a0aa31079ab1b6c6fa2ec05c79c1089d062..1c5f89fa8985405d353f106bb766d2e463d04ee4 100644 --- a/spec/features/projects/guest_navigation_menu_spec.rb +++ b/spec/features/projects/guest_navigation_menu_spec.rb @@ -7,7 +7,7 @@ describe 'Guest navigation menu' do before do project.team << [guest, :guest] - gitlab_sign_in(guest) + sign_in(guest) end it 'shows allowed tabs only' do diff --git a/spec/features/projects/import_export/export_file_spec.rb b/spec/features/projects/import_export/export_file_spec.rb index b7f0ad9197edd60e7830111dac40e6e015365a15..43c2c401f4a02a4b48dcba6f0d7755fbf116dc90 100644 --- a/spec/features/projects/import_export/export_file_spec.rb +++ b/spec/features/projects/import_export/export_file_spec.rb @@ -33,7 +33,7 @@ feature 'Import/Export - project export integration test', feature: true, js: tr context 'admin user' do before do - gitlab_sign_in(user) + sign_in(user) end scenario 'exports a project successfully' do diff --git a/spec/features/projects/import_export/import_file_spec.rb b/spec/features/projects/import_export/import_file_spec.rb index 3f8d225529800f4b7b8619e1c2ddb47d3d5e68af..533ff4612ff7113101c690400a04b53168fb594b 100644 --- a/spec/features/projects/import_export/import_file_spec.rb +++ b/spec/features/projects/import_export/import_file_spec.rb @@ -53,7 +53,6 @@ feature 'Import/Export - project import integration test', feature: true, js: tr select2(namespace.id, from: '#project_namespace_id') fill_in :project_path, with: project.name, visible: true click_link 'GitLab export' - attach_file('file', file) click_on 'Import project' diff --git a/spec/features/projects/import_export/namespace_export_file_spec.rb b/spec/features/projects/import_export/namespace_export_file_spec.rb index f12b28f05fcdeb969f7122c262776d7a10083dce..74ced0d3b3557f1d0bb66597662e3d7efd308e0f 100644 --- a/spec/features/projects/import_export/namespace_export_file_spec.rb +++ b/spec/features/projects/import_export/namespace_export_file_spec.rb @@ -16,7 +16,7 @@ feature 'Import/Export - Namespace export file cleanup', feature: true, js: true context 'admin user' do before do - gitlab_sign_in(:admin) + sign_in(create(:admin)) end context 'moving the namespace' do diff --git a/spec/features/projects/issuable_templates_spec.rb b/spec/features/projects/issuable_templates_spec.rb index 83d1dfd91a9897eca1c9ca5fdb6aa56400ce4d56..88bb678362b961e7bf3ac356306df880e57ebf4c 100644 --- a/spec/features/projects/issuable_templates_spec.rb +++ b/spec/features/projects/issuable_templates_spec.rb @@ -6,7 +6,7 @@ feature 'issuable templates', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user end context 'user creates an issue using templates' do @@ -124,11 +124,14 @@ feature 'issuable templates', feature: true, js: true do let(:merge_request) { create(:merge_request, :with_diffs, source_project: fork_project, target_project: project) } background do - gitlab_sign_out + sign_out(:user) + project.team << [fork_user, :developer] fork_project.team << [fork_user, :master] create(:forked_project_link, forked_to_project: fork_project, forked_from_project: project) - gitlab_sign_in fork_user + + sign_in(fork_user) + project.repository.create_file( fork_user, '.gitlab/merge_request_templates/feature-proposal.md', diff --git a/spec/features/projects/issues/list_spec.rb b/spec/features/projects/issues/list_spec.rb index 380ade24a3264bead40768986ed011548686ccc1..c2ca62508a45aa700cc835067c36998b6efb95d5 100644 --- a/spec/features/projects/issues/list_spec.rb +++ b/spec/features/projects/issues/list_spec.rb @@ -7,7 +7,7 @@ feature 'Issues List' do background do project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) end scenario 'user does not see create new list button' do diff --git a/spec/features/projects/issues/rss_spec.rb b/spec/features/projects/issues/rss_spec.rb index d68606ab54529d0e1dcb962acf4c02480619d38d..d274a1760a4dfab4b2c4873e77b0fd6bb17e8e6f 100644 --- a/spec/features/projects/issues/rss_spec.rb +++ b/spec/features/projects/issues/rss_spec.rb @@ -9,10 +9,11 @@ feature 'Project Issues RSS' do end context 'when signed in' do + let(:user) { create(:user) } + before do - user = create(:user) project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) visit path end diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index e52151e9585ee70472a39fe72c165a9267b6c670..411987573faab86bf6b38a28be75d7a7e3433ba7 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -16,7 +16,7 @@ feature 'Jobs', :feature do before do project.team << [user, user_access_level] - gitlab_sign_in(user) + sign_in(user) end describe "GET /:project/jobs" do @@ -391,8 +391,8 @@ feature 'Jobs', :feature do job.cancel! project.update(visibility_level: Gitlab::VisibilityLevel::PUBLIC) - gitlab_sign_out_direct - gitlab_sign_in(create(:user)) + sign_out(:user) + sign_in(create(:user)) visit project_job_path(project, job) end diff --git a/spec/features/projects/labels/issues_sorted_by_priority_spec.rb b/spec/features/projects/labels/issues_sorted_by_priority_spec.rb index 89e31a72869fdea140046942a5c823faed25cf40..652008bae73dc8e7a8c9b28f6af6c7f70daadb9c 100644 --- a/spec/features/projects/labels/issues_sorted_by_priority_spec.rb +++ b/spec/features/projects/labels/issues_sorted_by_priority_spec.rb @@ -28,7 +28,7 @@ feature 'Issue prioritization', feature: true do issue_2.labels << label_4 issue_1.labels << label_5 - gitlab_sign_in user + sign_in user visit project_issues_path(project, sort: 'label_priority') # Ensure we are indicating that issues are sorted by priority @@ -67,7 +67,7 @@ feature 'Issue prioritization', feature: true do issue_4.labels << label_4 # 7 issue_6.labels << label_5 # 8 - No priority - gitlab_sign_in user + sign_in user visit project_issues_path(project, sort: 'label_priority') expect(page).to have_selector('.dropdown-toggle', text: 'Label priority') diff --git a/spec/features/projects/labels/subscription_spec.rb b/spec/features/projects/labels/subscription_spec.rb index 04617bfe03e2736b6eb6e9a6ae4e41b6099ad9b5..58421e11e0a468d6554ac9450914636dc447eb59 100644 --- a/spec/features/projects/labels/subscription_spec.rb +++ b/spec/features/projects/labels/subscription_spec.rb @@ -10,7 +10,7 @@ feature 'Labels subscription', feature: true do context 'when signed in' do before do project.team << [user, :developer] - gitlab_sign_in user + sign_in user end scenario 'users can subscribe/unsubscribe to labels', js: true do diff --git a/spec/features/projects/labels/update_prioritization_spec.rb b/spec/features/projects/labels/update_prioritization_spec.rb index 034613ea6beeddc7833d8a691349e8b6f60b9e12..61f6d734ed3741cf39c89c876f3308ef622b6e40 100644 --- a/spec/features/projects/labels/update_prioritization_spec.rb +++ b/spec/features/projects/labels/update_prioritization_spec.rb @@ -14,7 +14,7 @@ feature 'Prioritize labels', feature: true do before do project.team << [user, :developer] - gitlab_sign_in user + sign_in user end scenario 'user can prioritize a group label', js: true do @@ -120,7 +120,7 @@ feature 'Prioritize labels', feature: true do it 'does not prioritize labels' do guest = create(:user) - gitlab_sign_in guest + sign_in guest visit project_labels_path(project) diff --git a/spec/features/projects/main/download_buttons_spec.rb b/spec/features/projects/main/download_buttons_spec.rb index b14e0f089f04c95efa5d4a7b392db3acecb35be0..8b952d2f3a5c61f8b19794b733297534d33665ca 100644 --- a/spec/features/projects/main/download_buttons_spec.rb +++ b/spec/features/projects/main/download_buttons_spec.rb @@ -22,7 +22,7 @@ feature 'Download buttons in project main page', feature: true do end background do - gitlab_sign_in(user) + sign_in(user) project.team << [user, role] end diff --git a/spec/features/projects/main/rss_spec.rb b/spec/features/projects/main/rss_spec.rb index 5f48253dd06c70e39a5d92b01178987a5e8f75c2..7914180b951c320d4a6555323ab28020b6d83665 100644 --- a/spec/features/projects/main/rss_spec.rb +++ b/spec/features/projects/main/rss_spec.rb @@ -1,14 +1,14 @@ require 'spec_helper' feature 'Project RSS' do + let(:user) { create(:user) } let(:project) { create(:project, :repository, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let(:path) { project_path(project) } context 'when signed in' do before do - user = create(:user) project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) visit path end diff --git a/spec/features/projects/members/group_links_spec.rb b/spec/features/projects/members/group_links_spec.rb index 61cd7db15f5ae2a576be1408ab22f0aee473fcae..b9154915b34fecc2e805448a1c247ff26e380649 100644 --- a/spec/features/projects/members/group_links_spec.rb +++ b/spec/features/projects/members/group_links_spec.rb @@ -9,7 +9,7 @@ feature 'Projects > Members > Anonymous user sees members', feature: true, js: t project.team << [user, :master] @group_link = create(:project_group_link, project: project, group: group) - gitlab_sign_in(user) + sign_in(user) visit project_settings_members_path(project) end diff --git a/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb b/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb index 1c429202abad6d1421ab3b6e4c2973636846750c..2c99c2c7888b7a2127e18a4545c82d77b4736472 100644 --- a/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb +++ b/spec/features/projects/members/group_member_cannot_leave_group_project_spec.rb @@ -7,7 +7,7 @@ feature 'Projects > Members > Group member cannot leave group project', feature: background do group.add_developer(user) - gitlab_sign_in(user) + sign_in(user) visit project_path(project) end diff --git a/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb b/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb index 7250a0d26fc9bf73a295501d9f3a351004d7974d..35142273eae3b18db51fb640b13ea28922b98696 100644 --- a/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb +++ b/spec/features/projects/members/group_member_cannot_request_access_to_his_group_project_spec.rb @@ -41,7 +41,7 @@ feature 'Projects > Members > Group member cannot request access to his group pr end def login_and_visit_project_page(user) - gitlab_sign_in(user) + sign_in(user) visit project_path(project) end end diff --git a/spec/features/projects/members/group_members_spec.rb b/spec/features/projects/members/group_members_spec.rb index 0acf5134cce5831dad94dab4f8dbe3760b2e5bb3..bfc604bb8d6b0011502c697e6e6d83ef07e569e4 100644 --- a/spec/features/projects/members/group_members_spec.rb +++ b/spec/features/projects/members/group_members_spec.rb @@ -13,7 +13,7 @@ feature 'Projects members', feature: true do background do project.team << [developer, :developer] group.add_owner(user) - gitlab_sign_in(user) + sign_in(user) end context 'with a group invitee' do diff --git a/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb b/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb index 5a28a7538f8fcc52e0ee56b5e9479d786ed7268b..46f5744b32dc8dfdebdb38248f27d0942fc4102f 100644 --- a/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb +++ b/spec/features/projects/members/group_requester_cannot_request_access_to_project_spec.rb @@ -8,7 +8,7 @@ feature 'Projects > Members > Group requester cannot request access to project', background do group.add_owner(owner) - gitlab_sign_in(user) + sign_in(user) visit group_path(group) perform_enqueued_jobs { click_link 'Request Access' } visit project_path(project) diff --git a/spec/features/projects/members/list_spec.rb b/spec/features/projects/members/list_spec.rb index b62bf2f62930c7845617bd333db74de378efd29b..301f68a67d318d592ec8b6b66e7379a02eeeff0b 100644 --- a/spec/features/projects/members/list_spec.rb +++ b/spec/features/projects/members/list_spec.rb @@ -9,7 +9,7 @@ feature 'Project members list', feature: true do let(:project) { create(:project, namespace: group) } background do - gitlab_sign_in(user1) + sign_in(user1) group.add_owner(user1) end diff --git a/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb b/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb index ca2172bb905903a84019d2db0a162f69d6e0fb77..14edfb6e6732591ec111ea0222f5711544a106f5 100644 --- a/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb +++ b/spec/features/projects/members/master_adds_member_with_expiration_date_spec.rb @@ -10,7 +10,7 @@ feature 'Projects > Members > Master adds member with expiration date', feature: background do project.team << [master, :master] - gitlab_sign_in(master) + sign_in(master) end scenario 'expiration date is displayed in the members list' do diff --git a/spec/features/projects/members/master_manages_access_requests_spec.rb b/spec/features/projects/members/master_manages_access_requests_spec.rb index 69c5927428c251c1a1866dd406a111e72eacddbd..a359c209556f928863a9eb44e5edb02c5a9b96af 100644 --- a/spec/features/projects/members/master_manages_access_requests_spec.rb +++ b/spec/features/projects/members/master_manages_access_requests_spec.rb @@ -8,7 +8,7 @@ feature 'Projects > Members > Master manages access requests', feature: true do background do project.request_access(user) project.team << [master, :master] - gitlab_sign_in(master) + sign_in(master) end scenario 'master can see access requests' do diff --git a/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb b/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb index f0da201da85d95c2cab8020a2122e8981737590c..55852012baeaa77d2a7a1dd48ae16dede44ceca6 100644 --- a/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb +++ b/spec/features/projects/members/member_cannot_request_access_to_his_project_spec.rb @@ -6,7 +6,7 @@ feature 'Projects > Members > Member cannot request access to his project', feat background do project.team << [member, :developer] - gitlab_sign_in(member) + sign_in(member) visit project_path(project) end diff --git a/spec/features/projects/members/member_leaves_project_spec.rb b/spec/features/projects/members/member_leaves_project_spec.rb index 31d8bbdc0b6021c4aac64d862e1b886987fae260..3de13aee0eeb61984045b53fd4e1b38c10bca27a 100644 --- a/spec/features/projects/members/member_leaves_project_spec.rb +++ b/spec/features/projects/members/member_leaves_project_spec.rb @@ -6,7 +6,7 @@ feature 'Projects > Members > Member leaves project', feature: true do background do project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) visit project_path(project) end diff --git a/spec/features/projects/members/owner_cannot_leave_project_spec.rb b/spec/features/projects/members/owner_cannot_leave_project_spec.rb index a1ccc6ddf65425ca25e68c4bcbdb56087b9af1fb..fae52325be05f6320c65fb0eeefa5420a40bf8fb 100644 --- a/spec/features/projects/members/owner_cannot_leave_project_spec.rb +++ b/spec/features/projects/members/owner_cannot_leave_project_spec.rb @@ -4,7 +4,7 @@ feature 'Projects > Members > Owner cannot leave project', feature: true do let(:project) { create(:project) } background do - gitlab_sign_in(project.owner) + sign_in(project.owner) visit project_path(project) end diff --git a/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb b/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb index 54f5d0d165ba75f0de08dfb0a011774a7518c72c..a7a5e01465fa2728d5dd4732bbfa85a7c851eb69 100644 --- a/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb +++ b/spec/features/projects/members/owner_cannot_request_access_to_his_project_spec.rb @@ -4,7 +4,7 @@ feature 'Projects > Members > Owner cannot request access to his project', featu let(:project) { create(:project) } background do - gitlab_sign_in(project.owner) + sign_in(project.owner) visit project_path(project) end diff --git a/spec/features/projects/members/sorting_spec.rb b/spec/features/projects/members/sorting_spec.rb index 7c02b49a0ab92ed523e3cab15319e57f874f4aac..afb613f034e74acfecc6dee2475a4ec8f7be1753 100644 --- a/spec/features/projects/members/sorting_spec.rb +++ b/spec/features/projects/members/sorting_spec.rb @@ -8,7 +8,7 @@ feature 'Projects > Members > Sorting', feature: true do background do create(:project_member, :developer, user: developer, project: project, created_at: 3.days.ago) - gitlab_sign_in(master) + sign_in(master) end scenario 'sorts alphabetically by default' do diff --git a/spec/features/projects/members/user_requests_access_spec.rb b/spec/features/projects/members/user_requests_access_spec.rb index 75a366a3eb751139430a05d50299fca82a883846..ab86e2da4f60a182ca91310d7be29fde1f4a3dd4 100644 --- a/spec/features/projects/members/user_requests_access_spec.rb +++ b/spec/features/projects/members/user_requests_access_spec.rb @@ -6,7 +6,7 @@ feature 'Projects > Members > User requests access', feature: true do let(:master) { project.owner } background do - gitlab_sign_in(user) + sign_in(user) visit project_path(project) end diff --git a/spec/features/projects/merge_request_button_spec.rb b/spec/features/projects/merge_request_button_spec.rb index 771dd7d3208a5cc41fb3096da24853f2fd1c0523..12b4747602de52200d14d396aa5fa5179461de50 100644 --- a/spec/features/projects/merge_request_button_spec.rb +++ b/spec/features/projects/merge_request_button_spec.rb @@ -18,7 +18,7 @@ feature 'Merge Request button', feature: true do context 'logged in as developer' do before do - gitlab_sign_in(user) + sign_in(user) project.team << [user, :developer] end @@ -51,7 +51,7 @@ feature 'Merge Request button', feature: true do context 'logged in as non-member' do before do - gitlab_sign_in(user) + sign_in(user) end it 'does not show Create merge request button' do diff --git a/spec/features/projects/merge_requests/list_spec.rb b/spec/features/projects/merge_requests/list_spec.rb index ff4d22b3881ad9c4af37a8a54b023beaa23028ff..6548b4b83e65a9d143fbbc7f85e882f5a00839cb 100644 --- a/spec/features/projects/merge_requests/list_spec.rb +++ b/spec/features/projects/merge_requests/list_spec.rb @@ -7,7 +7,7 @@ feature 'Merge Requests List' do background do project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) end scenario 'user does not see create new list button' do diff --git a/spec/features/projects/milestones/milestone_spec.rb b/spec/features/projects/milestones/milestone_spec.rb index 1913ef728d31c73ff215e0309ec80249039485c3..642ca7448a3c7be52c80e4efd2006eb2acc0d4af 100644 --- a/spec/features/projects/milestones/milestone_spec.rb +++ b/spec/features/projects/milestones/milestone_spec.rb @@ -6,7 +6,7 @@ feature 'Project milestone', :feature do let(:milestone) { create(:milestone, project: project) } before do - gitlab_sign_in(user) + sign_in(user) end context 'when project has enabled issues' do diff --git a/spec/features/projects/milestones/milestones_sorting_spec.rb b/spec/features/projects/milestones/milestones_sorting_spec.rb index 1b74758445ba78463e33add18f5f313ec638dfe0..53cd2711666978ad8a9dc0aa861747749d2ed1ff 100644 --- a/spec/features/projects/milestones/milestones_sorting_spec.rb +++ b/spec/features/projects/milestones/milestones_sorting_spec.rb @@ -15,7 +15,7 @@ feature 'Milestones sorting', :feature, :js do due_date: 11.days.from_now, created_at: 1.hour.ago, title: "bbb", project: project) - gitlab_sign_in(user) + sign_in(user) end scenario 'visit project milestones and sort by due_date_asc' do diff --git a/spec/features/projects/pages_spec.rb b/spec/features/projects/pages_spec.rb index e2cc38e276f420ecbdb758489653ef49b7fc2b06..a8593709f1b250d9e2c3ea55e5a3c64043b71aaa 100644 --- a/spec/features/projects/pages_spec.rb +++ b/spec/features/projects/pages_spec.rb @@ -10,7 +10,7 @@ feature 'Pages', feature: true do project.team << [user, role] - gitlab_sign_in(user) + sign_in(user) end shared_examples 'no pages deployed' do diff --git a/spec/features/projects/pipeline_schedules_spec.rb b/spec/features/projects/pipeline_schedules_spec.rb index fee54466b81922cd1c0979a83c6c359a2b19e059..992a68b25a5f7750669cb73f9206508725dc6c49 100644 --- a/spec/features/projects/pipeline_schedules_spec.rb +++ b/spec/features/projects/pipeline_schedules_spec.rb @@ -11,7 +11,7 @@ feature 'Pipeline Schedules', :feature, js: true do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) end describe 'GET /projects/pipeline_schedules' do diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index bd6750d2208fcfc23c3580fb81b1b1e445a70c4d..4a08d9088aa9201f16328125b19028f60edde49e 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -5,7 +5,7 @@ describe 'Pipeline', :feature, :js do let(:user) { create(:user) } before do - gitlab_sign_in(user) + sign_in(user) project.team << [user, :developer] end diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index a82a804e4c1892bd43adae1b31c9c42d0f43be94..d776fbc2b126dbc6137874a5b9893d767ef1750d 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -7,7 +7,7 @@ describe 'Pipelines', :feature, :js do let(:user) { create(:user) } before do - gitlab_sign_in(user) + sign_in(user) project.team << [user, :developer] end diff --git a/spec/features/projects/project_settings_spec.rb b/spec/features/projects/project_settings_spec.rb index 1f78f242399d1ae5e4ba57b54a91a61b536b83bc..89d227eb98fce67314836c87d76347398ab34438 100644 --- a/spec/features/projects/project_settings_spec.rb +++ b/spec/features/projects/project_settings_spec.rb @@ -7,7 +7,7 @@ describe 'Edit Project Settings', feature: true do let(:project) { create(:empty_project, namespace: user.namespace, path: 'gitlab', name: 'sample') } before do - gitlab_sign_in(user) + sign_in(user) end describe 'Project settings section', js: true do diff --git a/spec/features/projects/ref_switcher_spec.rb b/spec/features/projects/ref_switcher_spec.rb index 342f083f25a8a442fe9c10389445164460d72081..31c7b492ab7a03faa9887ec527856ab6d95396c9 100644 --- a/spec/features/projects/ref_switcher_spec.rb +++ b/spec/features/projects/ref_switcher_spec.rb @@ -6,7 +6,7 @@ feature 'Ref switcher', feature: true, js: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_tree_path(project, 'master') end diff --git a/spec/features/projects/services/jira_service_spec.rb b/spec/features/projects/services/jira_service_spec.rb index 9e4f420689cde66296a3c76ecfcd18bbf8279e39..7c29af247d65f8f53e3f3843d550192871525303 100644 --- a/spec/features/projects/services/jira_service_spec.rb +++ b/spec/features/projects/services/jira_service_spec.rb @@ -24,7 +24,7 @@ feature 'Setup Jira service', :feature, :js do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_settings_integrations_path(project) end diff --git a/spec/features/projects/services/mattermost_slash_command_spec.rb b/spec/features/projects/services/mattermost_slash_command_spec.rb index aaa354903aad95c53531a2885278be9d10b45009..584d3ed8f42dd824c6be408873e1cb5b10ab3670 100644 --- a/spec/features/projects/services/mattermost_slash_command_spec.rb +++ b/spec/features/projects/services/mattermost_slash_command_spec.rb @@ -9,7 +9,7 @@ feature 'Setup Mattermost slash commands', :feature, :js do before do stub_mattermost_setting(enabled: mattermost_enabled) project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit edit_project_service_path(project, service) end diff --git a/spec/features/projects/services/slack_service_spec.rb b/spec/features/projects/services/slack_service_spec.rb index 5e3c3b00476d10edf5f5a97d367924cc3f14e32b..709cd1226c3c3d5c28cde3f19557b4755dc72a64 100644 --- a/spec/features/projects/services/slack_service_spec.rb +++ b/spec/features/projects/services/slack_service_spec.rb @@ -9,7 +9,7 @@ feature 'Projects > Slack service > Setup events', feature: true do service.fields service.update_attributes(push_channel: 1, issue_channel: 2, merge_request_channel: 3, note_channel: 4, tag_push_channel: 5, pipeline_channel: 6, wiki_page_channel: 7) project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end scenario 'user can filter events by channel' do diff --git a/spec/features/projects/services/slack_slash_command_spec.rb b/spec/features/projects/services/slack_slash_command_spec.rb index aaa775ce51f6586e9c661c224c35606fe00895b7..4efe484262a3b3bfd098a99279772ca04179fb2d 100644 --- a/spec/features/projects/services/slack_slash_command_spec.rb +++ b/spec/features/projects/services/slack_slash_command_spec.rb @@ -7,7 +7,7 @@ feature 'Slack slash commands', feature: true do background do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit edit_project_service_path(project, service) end diff --git a/spec/features/projects/settings/integration_settings_spec.rb b/spec/features/projects/settings/integration_settings_spec.rb index f708a3009f1aa25c3716e7de5279ec293dd62922..13313bfde24ce33b0171da5de3e1c786beca4457 100644 --- a/spec/features/projects/settings/integration_settings_spec.rb +++ b/spec/features/projects/settings/integration_settings_spec.rb @@ -7,7 +7,7 @@ feature 'Integration settings', feature: true do let(:integrations_path) { project_settings_integrations_path(project) } background do - gitlab_sign_in(user) + sign_in(user) project.team << [user, role] end diff --git a/spec/features/projects/settings/merge_requests_settings_spec.rb b/spec/features/projects/settings/merge_requests_settings_spec.rb index 451e2f3e04e0f1371c04747f8659a29822af06a4..ecaf65c4ad9e3ee12deddabb5f402a74b480b129 100644 --- a/spec/features/projects/settings/merge_requests_settings_spec.rb +++ b/spec/features/projects/settings/merge_requests_settings_spec.rb @@ -6,7 +6,7 @@ feature 'Project settings > Merge Requests', feature: true, js: true do background do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'when Merge Request and Pipelines are initially enabled' do diff --git a/spec/features/projects/settings/pipelines_settings_spec.rb b/spec/features/projects/settings/pipelines_settings_spec.rb index 0d78feb2b93f24214e460fb1f473135f152adcb8..724cfa10e72c8dc4858e6de3d424a81a1f66812c 100644 --- a/spec/features/projects/settings/pipelines_settings_spec.rb +++ b/spec/features/projects/settings/pipelines_settings_spec.rb @@ -6,7 +6,7 @@ feature "Pipelines settings", feature: true do let(:role) { :developer } background do - gitlab_sign_in(user) + sign_in(user) project.team << [user, role] visit project_pipelines_settings_path(project) end diff --git a/spec/features/projects/settings/repository_settings_spec.rb b/spec/features/projects/settings/repository_settings_spec.rb index 9cc04925a0aafeab00804cbc6df29dd5c86d98a4..98539518f6c067ee78f2c3e07427932e4388c781 100644 --- a/spec/features/projects/settings/repository_settings_spec.rb +++ b/spec/features/projects/settings/repository_settings_spec.rb @@ -7,7 +7,7 @@ feature 'Repository settings', feature: true do background do project.team << [user, role] - gitlab_sign_in(user) + sign_in(user) end context 'for developer' do diff --git a/spec/features/projects/settings/visibility_settings_spec.rb b/spec/features/projects/settings/visibility_settings_spec.rb index a9a6441d4e8241db94e3df15e5921b003562ca6e..32d8f1fd16a00d9a45e03fa7df7676a33b0cf4e1 100644 --- a/spec/features/projects/settings/visibility_settings_spec.rb +++ b/spec/features/projects/settings/visibility_settings_spec.rb @@ -6,7 +6,7 @@ feature 'Visibility settings', feature: true, js: true do context 'as owner' do before do - gitlab_sign_in(user) + sign_in(user) visit edit_project_path(project) end @@ -32,7 +32,7 @@ feature 'Visibility settings', feature: true, js: true do before do project.team << [master_user, :master] - gitlab_sign_in(master_user) + sign_in(master_user) visit edit_project_path(project) end diff --git a/spec/features/projects/shortcuts_spec.rb b/spec/features/projects/shortcuts_spec.rb index 682bea87c8a835f206e6e382dbf0de4b51feeefd..8dd70e07b30160dc72a1c316bc53a77f961d03d5 100644 --- a/spec/features/projects/shortcuts_spec.rb +++ b/spec/features/projects/shortcuts_spec.rb @@ -7,7 +7,7 @@ feature 'Project shortcuts', feature: true do describe 'On a project', js: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_path(project) end diff --git a/spec/features/projects/snippets/create_snippet_spec.rb b/spec/features/projects/snippets/create_snippet_spec.rb index 37c11c0e88d1bdc83622be847f01c76f7862f7d2..06d32423a139d023c9fe10abddf942b286cab2ce 100644 --- a/spec/features/projects/snippets/create_snippet_spec.rb +++ b/spec/features/projects/snippets/create_snippet_spec.rb @@ -17,7 +17,7 @@ feature 'Create Snippet', :js, feature: true do context 'when a user is authenticated' do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_snippets_path(project) diff --git a/spec/features/projects/snippets/show_spec.rb b/spec/features/projects/snippets/show_spec.rb index d401d09497f1e1215696ba820f0c5f0a46ad63b5..52698fe1fa3211c738eaaca8aa11180af46bc099 100644 --- a/spec/features/projects/snippets/show_spec.rb +++ b/spec/features/projects/snippets/show_spec.rb @@ -7,7 +7,7 @@ feature 'Project snippet', :js, feature: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'Ruby file' do diff --git a/spec/features/projects/snippets_spec.rb b/spec/features/projects/snippets_spec.rb index 8edef2eba1371fde8acb4dc1e822decdaaa1366e..513a05151b26351f67795bdbe3ce661a3ecaf405 100644 --- a/spec/features/projects/snippets_spec.rb +++ b/spec/features/projects/snippets_spec.rb @@ -29,7 +29,7 @@ describe 'Project snippets', :js, feature: true do context 'when submitting a note' do before do - gitlab_sign_in :admin + sign_in(create(:admin)) visit project_snippet_path(project, snippets[0]) end diff --git a/spec/features/projects/sub_group_issuables_spec.rb b/spec/features/projects/sub_group_issuables_spec.rb index 5bbad78d0bb0401e8a20b0d63d58a33d55b45d74..007910bb931add527603bd7b4fac832cb350f480 100644 --- a/spec/features/projects/sub_group_issuables_spec.rb +++ b/spec/features/projects/sub_group_issuables_spec.rb @@ -8,7 +8,7 @@ describe 'Subgroup Issuables', :feature, :js, :nested_groups do before do project.add_master(user) - gitlab_sign_in user + sign_in user end it 'shows the full subgroup title when issues index page is empty' do diff --git a/spec/features/projects/tags/download_buttons_spec.rb b/spec/features/projects/tags/download_buttons_spec.rb index 186876e454fd8c5b1f1211e2b057e0c0344f80f4..34c5e59c3e569e83f352e19d11765ae47f5dc549 100644 --- a/spec/features/projects/tags/download_buttons_spec.rb +++ b/spec/features/projects/tags/download_buttons_spec.rb @@ -23,7 +23,7 @@ feature 'Download buttons in tags page', feature: true do end background do - gitlab_sign_in(user) + sign_in(user) project.team << [user, role] end diff --git a/spec/features/projects/tree/rss_spec.rb b/spec/features/projects/tree/rss_spec.rb index 4583374c931e13fbe59d51d302038c63911c6eee..4f2e0a76a651b90b4faed6727dcdf92d0795fb04 100644 --- a/spec/features/projects/tree/rss_spec.rb +++ b/spec/features/projects/tree/rss_spec.rb @@ -1,14 +1,14 @@ require 'spec_helper' feature 'Project Tree RSS' do + let(:user) { create(:user) } let(:project) { create(:project, :repository, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } let(:path) { project_tree_path(project, :master) } context 'when signed in' do before do - user = create(:user) project.team << [user, :developer] - gitlab_sign_in(user) + sign_in(user) visit path end diff --git a/spec/features/projects/user_create_dir_spec.rb b/spec/features/projects/user_create_dir_spec.rb index 01f288934bfaad2a6c5aaf8d9b83828901b37852..5e302da8a6339566ca4abd5c25ed08581a4c4868 100644 --- a/spec/features/projects/user_create_dir_spec.rb +++ b/spec/features/projects/user_create_dir_spec.rb @@ -6,7 +6,7 @@ feature 'New directory creation', feature: true, js: true do given(:project) { create(:project) } background do - gitlab_sign_in(user) + sign_in(user) project.team << [user, role] visit project_tree_path(project, 'master') open_new_directory_modal diff --git a/spec/features/projects/view_on_env_spec.rb b/spec/features/projects/view_on_env_spec.rb index 0c06aa25c06355dad80d07ab58d81e987d3059de..2a316a0d0db70a0ba1f6f3c323e2564679adefac 100644 --- a/spec/features/projects/view_on_env_spec.rb +++ b/spec/features/projects/view_on_env_spec.rb @@ -50,7 +50,7 @@ describe 'View on environment', js: true do let(:merge_request) { create(:merge_request, :simple, source_project: project, source_branch: branch_name) } before do - gitlab_sign_in(user) + sign_in(user) visit diffs_project_merge_request_path(project, merge_request) @@ -66,7 +66,7 @@ describe 'View on environment', js: true do context 'when visiting a comparison for the branch' do before do - gitlab_sign_in(user) + sign_in(user) visit project_compare_path(project, from: 'master', to: branch_name) @@ -80,7 +80,7 @@ describe 'View on environment', js: true do context 'when visiting a comparison for the commit' do before do - gitlab_sign_in(user) + sign_in(user) visit project_compare_path(project, from: 'master', to: sha) @@ -94,7 +94,7 @@ describe 'View on environment', js: true do context 'when visiting a blob on the branch' do before do - gitlab_sign_in(user) + sign_in(user) visit project_blob_path(project, File.join(branch_name, file_path)) @@ -108,7 +108,7 @@ describe 'View on environment', js: true do context 'when visiting a blob on the commit' do before do - gitlab_sign_in(user) + sign_in(user) visit project_blob_path(project, File.join(sha, file_path)) @@ -122,7 +122,7 @@ describe 'View on environment', js: true do context 'when visiting the commit' do before do - gitlab_sign_in(user) + sign_in(user) visit project_commit_path(project, sha) diff --git a/spec/features/projects/wiki/markdown_preview_spec.rb b/spec/features/projects/wiki/markdown_preview_spec.rb index d79ab809c7df0b683eb6c38b8bee5f2182bd6c0a..231e8eed4fb134d47018bf717a20e61af5652c94 100644 --- a/spec/features/projects/wiki/markdown_preview_spec.rb +++ b/spec/features/projects/wiki/markdown_preview_spec.rb @@ -16,7 +16,7 @@ feature 'Projects > Wiki > User previews markdown changes', feature: true, js: t project.team << [user, :master] WikiPages::CreateService.new(project, user, title: 'home', content: 'Home page').execute - gitlab_sign_in(user) + sign_in(user) visit project_path(project) find('.shortcuts-wiki').trigger('click') diff --git a/spec/features/projects/wiki/shortcuts_spec.rb b/spec/features/projects/wiki/shortcuts_spec.rb index d189f84da0ee43004a12024f91414b94c866e1d2..ea816082479b43a9317e74f999ec92eba28f57ce 100644 --- a/spec/features/projects/wiki/shortcuts_spec.rb +++ b/spec/features/projects/wiki/shortcuts_spec.rb @@ -8,7 +8,7 @@ feature 'Wiki shortcuts', :feature, :js do end before do - gitlab_sign_in(user) + sign_in(user) visit project_wiki_path(project, wiki_page) end diff --git a/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb b/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb index 749721b97ebaf94f4ce6abeabfff05654eb04894..9445b88af8dfd06af893c0376ae0e5abc6baf26c 100644 --- a/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_git_access_wiki_page_spec.rb @@ -13,7 +13,7 @@ describe 'Projects > Wiki > User views Git access wiki page', :feature do end before do - gitlab_sign_in(user) + sign_in(user) end scenario 'Visit Wiki Page Current Commit' do diff --git a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb index 3b9f7ff96fb6776f888b4403b9b13971463ee4b1..425195840d8494afcea911c20869d9953c32b796 100644 --- a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb @@ -6,7 +6,7 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do background do project.team << [user, :master] WikiPages::CreateService.new(project, user, title: 'home', content: 'Home page').execute - gitlab_sign_in(user) + sign_in(user) visit project_wikis_path(project) end diff --git a/spec/features/projects/wiki/user_views_project_wiki_page_spec.rb b/spec/features/projects/wiki/user_views_project_wiki_page_spec.rb index 8e3912d994e2915d1c33031166c510bd4c7b3813..13e882ad6659b973fc27843be5315a0fa41f65f2 100644 --- a/spec/features/projects/wiki/user_views_project_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_views_project_wiki_page_spec.rb @@ -15,7 +15,7 @@ feature 'Projects > Wiki > User views the wiki page', feature: true do background do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) WikiPages::UpdateService.new( project, user, diff --git a/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb b/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb index a305d27c7ec37e8194abfdb3c08fef57c2185d16..2234af1d7955bc58f6999d0cad17456731d21187 100644 --- a/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb +++ b/spec/features/projects/wiki/user_views_wiki_in_project_page_spec.rb @@ -5,7 +5,7 @@ describe 'Projects > Wiki > User views wiki in project page', feature: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'when repository is disabled for project' do diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb index 361e3a6d8e599a65e82beb4023cb124e26b3b567..10c7e5934e447c0c6e25210401403917b5d537b2 100644 --- a/spec/features/projects_spec.rb +++ b/spec/features/projects_spec.rb @@ -6,7 +6,7 @@ feature 'Project', feature: true do let(:path) { project_path(project) } before do - gitlab_sign_in(:admin) + sign_in(create(:admin)) end it 'parses Markdown' do @@ -39,7 +39,7 @@ feature 'Project', feature: true do let(:project) { create(:empty_project, namespace: user.namespace) } before do - gitlab_sign_in user + sign_in user create(:forked_project_link, forked_to_project: project) visit edit_project_path(project) end @@ -60,7 +60,7 @@ feature 'Project', feature: true do let(:project) { create(:empty_project, namespace: user.namespace, name: 'project1') } before do - gitlab_sign_in(user) + sign_in(user) project.team << [user, :master] visit edit_project_path(project) end @@ -79,7 +79,7 @@ feature 'Project', feature: true do let(:project) { create(:empty_project, namespace: user.namespace) } before do - gitlab_sign_in(user) + sign_in(user) project.add_user(user, Gitlab::Access::MASTER) visit project_path(project) end @@ -98,7 +98,7 @@ feature 'Project', feature: true do context 'on issues page', js: true do before do - gitlab_sign_in(user) + sign_in(user) project.add_user(user, Gitlab::Access::MASTER) project2.add_user(user, Gitlab::Access::MASTER) visit project_issue_path(project, issue) @@ -123,7 +123,7 @@ feature 'Project', feature: true do before do project.team << [user, :master] - gitlab_sign_in user + sign_in user visit project_path(project) end diff --git a/spec/features/protected_branches_spec.rb b/spec/features/protected_branches_spec.rb index 952eb6c364330c329e79e38b1943f9d2288cb88e..8a3574546c2c830366e1d12e5072eb6bb9fd6ee1 100644 --- a/spec/features/protected_branches_spec.rb +++ b/spec/features/protected_branches_spec.rb @@ -5,7 +5,7 @@ feature 'Protected Branches', feature: true, js: true do let(:project) { create(:project, :repository) } before do - gitlab_sign_in(user) + sign_in(user) end def set_protected_branch_name(branch_name) diff --git a/spec/features/protected_tags_spec.rb b/spec/features/protected_tags_spec.rb index 4ffd97fb221e3924d0daea49de1bb7d8e714e660..7a22cf60996745184c7ccf7e3c8066f8b063e8ca 100644 --- a/spec/features/protected_tags_spec.rb +++ b/spec/features/protected_tags_spec.rb @@ -5,7 +5,7 @@ feature 'Projected Tags', feature: true, js: true do let(:project) { create(:project, :repository) } before do - gitlab_sign_in(user) + sign_in(user) end def set_protected_tag_name(tag_name) diff --git a/spec/features/reportable_note/commit_spec.rb b/spec/features/reportable_note/commit_spec.rb index 2486f779753bc391a7750aee3e2b1d552c97d473..d82ebe02f77bdfd6b25446878f06478f544e5e27 100644 --- a/spec/features/reportable_note/commit_spec.rb +++ b/spec/features/reportable_note/commit_spec.rb @@ -8,7 +8,7 @@ describe 'Reportable note on commit', :feature, :js do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) end context 'a normal note' do diff --git a/spec/features/reportable_note/issue_spec.rb b/spec/features/reportable_note/issue_spec.rb index d283c2d3c8f51842b161cbf2ce2c8b7a4d3daa5c..cb1cb1a14170c9e6c13934a7581cff04e449c9f6 100644 --- a/spec/features/reportable_note/issue_spec.rb +++ b/spec/features/reportable_note/issue_spec.rb @@ -8,7 +8,7 @@ describe 'Reportable note on issue', :feature, :js do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) visit project_issue_path(project, issue) end diff --git a/spec/features/reportable_note/merge_request_spec.rb b/spec/features/reportable_note/merge_request_spec.rb index fe25c894b858e4148006aa090df7a7f2759d02ff..8a531b9a9e9b6b8a69953ff39acc9d00f3eca93b 100644 --- a/spec/features/reportable_note/merge_request_spec.rb +++ b/spec/features/reportable_note/merge_request_spec.rb @@ -7,7 +7,7 @@ describe 'Reportable note on merge request', :feature, :js do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) visit project_merge_request_path(project, merge_request) end diff --git a/spec/features/reportable_note/snippets_spec.rb b/spec/features/reportable_note/snippets_spec.rb index b3044d3d04817e8e90ce0bedeac22af14317d205..f560a0ebfd9163d299d38d73915822039bb1ad75 100644 --- a/spec/features/reportable_note/snippets_spec.rb +++ b/spec/features/reportable_note/snippets_spec.rb @@ -6,7 +6,7 @@ describe 'Reportable note on snippets', :feature, :js do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) end describe 'on project snippet' do diff --git a/spec/features/runners_spec.rb b/spec/features/runners_spec.rb index 00f59f8f197dd982f3da2d5eba76fcb96c84d6f0..1725b70acf325e881fc3966576bae58719822829 100644 --- a/spec/features/runners_spec.rb +++ b/spec/features/runners_spec.rb @@ -4,7 +4,7 @@ describe "Runners" do let(:user) { create(:user) } before do - gitlab_sign_in(user) + sign_in(user) end describe "specific runners" do diff --git a/spec/features/search_spec.rb b/spec/features/search_spec.rb index 69b4219395583ea0d42f596a31b3b028d281f973..12ef23440b710a672eee1a842b844addba2f97bd 100644 --- a/spec/features/search_spec.rb +++ b/spec/features/search_spec.rb @@ -9,7 +9,7 @@ describe "Search", feature: true do let!(:issue2) { create(:issue, project: project, author: user) } before do - gitlab_sign_in(user) + sign_in(user) project.team << [user, :reporter] visit search_path end diff --git a/spec/features/snippets/explore_spec.rb b/spec/features/snippets/explore_spec.rb index ec75817b942cfc1bce43763b46c02543bb0df7e7..97d1c2d65e66932c575ca4f3a8fe5d65e3512db3 100644 --- a/spec/features/snippets/explore_spec.rb +++ b/spec/features/snippets/explore_spec.rb @@ -6,7 +6,7 @@ feature 'Explore Snippets', feature: true do let!(:private_snippet) { create(:personal_snippet, :private) } scenario 'User should see snippets that are not private' do - gitlab_sign_in create(:user) + sign_in create(:user) visit explore_snippets_path expect(page).to have_content(public_snippet.title) @@ -15,7 +15,7 @@ feature 'Explore Snippets', feature: true do end scenario 'External user should see only public snippets' do - gitlab_sign_in create(:user, :external) + sign_in create(:user, :external) visit explore_snippets_path expect(page).to have_content(public_snippet.title) diff --git a/spec/features/snippets/internal_snippet_spec.rb b/spec/features/snippets/internal_snippet_spec.rb index 3babb1c02ccc29774cb307f674ed1ab290da3523..fb3e75f210263a02abff42049ae1411b1e0f7ebf 100644 --- a/spec/features/snippets/internal_snippet_spec.rb +++ b/spec/features/snippets/internal_snippet_spec.rb @@ -5,7 +5,7 @@ feature 'Internal Snippets', feature: true, js: true do describe 'normal user' do before do - gitlab_sign_in :user + sign_in(create(:user)) end scenario 'sees internal snippets' do diff --git a/spec/features/snippets/notes_on_personal_snippets_spec.rb b/spec/features/snippets/notes_on_personal_snippets_spec.rb index c7e2e3d8a3446dc466f6250aff7271e1c7c5c428..17e93209f0c36e2dc225b0c873ece5cd839fc06d 100644 --- a/spec/features/snippets/notes_on_personal_snippets_spec.rb +++ b/spec/features/snippets/notes_on_personal_snippets_spec.rb @@ -14,7 +14,7 @@ describe 'Comments on personal snippets', :js, feature: true do let!(:other_note) { create(:note_on_personal_snippet) } before do - gitlab_sign_in user + sign_in user visit snippet_path(snippet) end diff --git a/spec/features/snippets/search_snippets_spec.rb b/spec/features/snippets/search_snippets_spec.rb index 4c21e7321f4e16690aea2f58536805288867c407..5483df39a8b751d108110fdaeef57cb722c2e380 100644 --- a/spec/features/snippets/search_snippets_spec.rb +++ b/spec/features/snippets/search_snippets_spec.rb @@ -5,7 +5,7 @@ feature 'Search Snippets', feature: true do public_snippet = create(:personal_snippet, :public, title: 'Beginning and Middle') private_snippet = create(:personal_snippet, :private, title: 'Middle and End') - gitlab_sign_in private_snippet.author + sign_in private_snippet.author visit dashboard_snippets_path page.within '.search' do @@ -41,7 +41,7 @@ feature 'Search Snippets', feature: true do CONTENT ) - gitlab_sign_in create(:user) + sign_in create(:user) visit dashboard_snippets_path page.within '.search' do diff --git a/spec/features/snippets/user_snippets_spec.rb b/spec/features/snippets/user_snippets_spec.rb index b971c6aab530e5b1481ff8deffedd183722512b8..019310f232691868749240f10a4814e283cc911a 100644 --- a/spec/features/snippets/user_snippets_spec.rb +++ b/spec/features/snippets/user_snippets_spec.rb @@ -7,7 +7,7 @@ feature 'User Snippets', feature: true do let!(:private_snippet) { create(:personal_snippet, :private, author: author, title: "This is a private snippet") } background do - gitlab_sign_in author + sign_in author visit dashboard_snippets_path end diff --git a/spec/features/tags/master_creates_tag_spec.rb b/spec/features/tags/master_creates_tag_spec.rb index 3bf5544a837e9887ed21beeaca93f1c29c8dec45..1cef3d5c6f4df1b228a7e116cf023cf5c183b535 100644 --- a/spec/features/tags/master_creates_tag_spec.rb +++ b/spec/features/tags/master_creates_tag_spec.rb @@ -6,7 +6,7 @@ feature 'Master creates tag', feature: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'from tag list' do diff --git a/spec/features/tags/master_deletes_tag_spec.rb b/spec/features/tags/master_deletes_tag_spec.rb index 04f9cecd46d1b519ea3413210d88d3b52911ae1c..98af1d6b4f7a569345513fdcf62149ab6b0d4473 100644 --- a/spec/features/tags/master_deletes_tag_spec.rb +++ b/spec/features/tags/master_deletes_tag_spec.rb @@ -6,7 +6,7 @@ feature 'Master deletes tag', feature: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_tags_path(project) end diff --git a/spec/features/tags/master_updates_tag_spec.rb b/spec/features/tags/master_updates_tag_spec.rb index 092ffbb6d23f74bae7d3e75dc6fcc6c22409287d..1b61fde72277362b00d0cefd9c6d4e67b411b37d 100644 --- a/spec/features/tags/master_updates_tag_spec.rb +++ b/spec/features/tags/master_updates_tag_spec.rb @@ -6,7 +6,7 @@ feature 'Master updates tag', feature: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit project_tags_path(project) end diff --git a/spec/features/tags/master_views_tags_spec.rb b/spec/features/tags/master_views_tags_spec.rb index b1f3207eeea7e1564f60603a986f0f0262465c8a..fb910feae34171a20ea35d67049af1a769d6c108 100644 --- a/spec/features/tags/master_views_tags_spec.rb +++ b/spec/features/tags/master_views_tags_spec.rb @@ -5,7 +5,7 @@ feature 'Master views tags', feature: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'when project has no tags' do diff --git a/spec/features/uploads/user_uploads_avatar_to_group_spec.rb b/spec/features/uploads/user_uploads_avatar_to_group_spec.rb index 797b7b3d50d0d2f07f21340a3f5dbe1d48441578..32784de16131544e6694e7195ef94796341f7f8b 100644 --- a/spec/features/uploads/user_uploads_avatar_to_group_spec.rb +++ b/spec/features/uploads/user_uploads_avatar_to_group_spec.rb @@ -5,7 +5,7 @@ feature 'User uploads avatar to group', feature: true do user = create(:user) group = create(:group) group.add_owner(user) - gitlab_sign_in(user) + sign_in(user) visit edit_group_path(group) attach_file( diff --git a/spec/features/uploads/user_uploads_avatar_to_profile_spec.rb b/spec/features/uploads/user_uploads_avatar_to_profile_spec.rb index a3f8027f4da582d8bdeebb3d1ca722a3c7dc8f51..82c356735b96dd82580469aac78db281b53ef9cc 100644 --- a/spec/features/uploads/user_uploads_avatar_to_profile_spec.rb +++ b/spec/features/uploads/user_uploads_avatar_to_profile_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' feature 'User uploads avatar to profile', feature: true do scenario 'they see their new avatar' do user = create(:user) - gitlab_sign_in(user) + sign_in(user) visit profile_path attach_file( diff --git a/spec/features/uploads/user_uploads_file_to_note_spec.rb b/spec/features/uploads/user_uploads_file_to_note_spec.rb index 736178897a648fd335302f682d229bf9cf857d1e..01f10ca0933df893e61a3e1199d695dfac268e6b 100644 --- a/spec/features/uploads/user_uploads_file_to_note_spec.rb +++ b/spec/features/uploads/user_uploads_file_to_note_spec.rb @@ -8,7 +8,7 @@ feature 'User uploads file to note', feature: true do let(:issue) { create(:issue, project: project, author: user) } before do - gitlab_sign_in(user) + sign_in(user) visit project_issue_path(project, issue) end diff --git a/spec/features/user_callout_spec.rb b/spec/features/user_callout_spec.rb index 7538a6e4a04d329cc2f0863f7e133e64c2ef8775..93768aa46df15c4e28d9b778ed0ff0637936c0bd 100644 --- a/spec/features/user_callout_spec.rb +++ b/spec/features/user_callout_spec.rb @@ -6,7 +6,7 @@ describe 'User Callouts', js: true do let(:project) { create(:empty_project, path: 'gitlab', name: 'sample') } before do - gitlab_sign_in(user) + sign_in(user) project.team << [user, :master] end diff --git a/spec/features/user_can_display_performance_bar_spec.rb b/spec/features/user_can_display_performance_bar_spec.rb index 9452fe6d92a839aa733e3babd2b03ec0c62e8e8b..670e8dda916fda597affdb9ee918235ab353c78a 100644 --- a/spec/features/user_can_display_performance_bar_spec.rb +++ b/spec/features/user_can_display_performance_bar_spec.rb @@ -61,7 +61,7 @@ describe 'User can display performance bar', :js do before do user = create(:user) - gitlab_sign_in(user) + sign_in(user) group.add_guest(user) visit root_path diff --git a/spec/features/users/projects_spec.rb b/spec/features/users/projects_spec.rb index 377b1a0148f11c863851ff7cfe0215fe59978336..797ed0e6437322183d523f7259bec7b98beb79e4 100644 --- a/spec/features/users/projects_spec.rb +++ b/spec/features/users/projects_spec.rb @@ -8,7 +8,7 @@ describe 'Projects tab on a user profile', :feature, :js do before do allow(Project).to receive(:default_per_page).and_return(1) - gitlab_sign_in(user) + sign_in(user) visit user_path(user) diff --git a/spec/features/users/rss_spec.rb b/spec/features/users/rss_spec.rb index 797b317a9bb803c4befcbf8afdf483481ea42a66..7c5abe54d560a9530718fc4ee83433adf6d171f2 100644 --- a/spec/features/users/rss_spec.rb +++ b/spec/features/users/rss_spec.rb @@ -1,11 +1,12 @@ require 'spec_helper' feature 'User RSS' do + let(:user) { create(:user) } let(:path) { user_path(create(:user)) } context 'when signed in' do before do - gitlab_sign_in(create(:user)) + sign_in(user) visit path end diff --git a/spec/features/users/snippets_spec.rb b/spec/features/users/snippets_spec.rb index 74c5cbd7887d7a3cc541594fc43dfdbb4066d54a..42738b137af66efbf7e27774bd5f944e2f974960 100644 --- a/spec/features/users/snippets_spec.rb +++ b/spec/features/users/snippets_spec.rb @@ -24,7 +24,7 @@ describe 'Snippets tab on a user profile', feature: true, js: true do let!(:other_snippet) { create(:snippet, :public) } it 'contains only internal and public snippets of a user when a user is logged in' do - gitlab_sign_in(:user) + sign_in(create(:user)) visit user_path(user) page.within('.user-profile-nav') { click_link 'Snippets' } wait_for_requests diff --git a/spec/features/variables_spec.rb b/spec/features/variables_spec.rb index 7acf7a089af6e6fb18be714fb29c8208a84c2ec8..dd770fe5043499aa775a2d309ae3c0b3a5df0c9d 100644 --- a/spec/features/variables_spec.rb +++ b/spec/features/variables_spec.rb @@ -6,7 +6,7 @@ describe 'Project variables', js: true do let(:variable) { create(:ci_variable, key: 'test_key', value: 'test value') } before do - gitlab_sign_in(user) + sign_in(user) project.team << [user, :master] project.variables << variable diff --git a/spec/support/features/issuable_slash_commands_shared_examples.rb b/spec/support/features/issuable_slash_commands_shared_examples.rb index 98b014df6cd5677c55d29a71e069ea751a2aba56..033e338fe61482c8172812f3db9cbbd216d8406e 100644 --- a/spec/support/features/issuable_slash_commands_shared_examples.rb +++ b/spec/support/features/issuable_slash_commands_shared_examples.rb @@ -17,7 +17,8 @@ shared_examples 'issuable record that supports quick actions in its description project.team << [master, :master] project.team << [assignee, :developer] project.team << [guest, :guest] - gitlab_sign_in(master) + + sign_in(master) end after do @@ -110,8 +111,8 @@ shared_examples 'issuable record that supports quick actions in its description context "when current user cannot close #{issuable_type}" do before do - gitlab_sign_out - gitlab_sign_in(guest) + sign_out(:user) + sign_in(guest) visit public_send("namespace_project_#{issuable_type}_path", project.namespace, project, issuable) end @@ -145,8 +146,8 @@ shared_examples 'issuable record that supports quick actions in its description context "when current user cannot reopen #{issuable_type}" do before do - gitlab_sign_out - gitlab_sign_in(guest) + sign_out(:user) + sign_in(guest) visit public_send("namespace_project_#{issuable_type}_path", project.namespace, project, issuable) end @@ -175,8 +176,8 @@ shared_examples 'issuable record that supports quick actions in its description context "when current user cannot change title of #{issuable_type}" do before do - gitlab_sign_out - gitlab_sign_in(guest) + sign_out(:user) + sign_in(guest) visit public_send("namespace_project_#{issuable_type}_path", project.namespace, project, issuable) end diff --git a/spec/support/features/rss_shared_examples.rb b/spec/support/features/rss_shared_examples.rb index 1cbb413499585a948684c5c24541b21a69c5b5b8..50fbbc7f55b569ec5e328d73c2515782d2d44134 100644 --- a/spec/support/features/rss_shared_examples.rb +++ b/spec/support/features/rss_shared_examples.rb @@ -1,12 +1,12 @@ shared_examples "an autodiscoverable RSS feed with current_user's RSS token" do it "has an RSS autodiscovery link tag with current_user's RSS token" do - expect(page).to have_css("link[type*='atom+xml'][href*='rss_token=#{Thread.current[:current_user].rss_token}']", visible: false) + expect(page).to have_css("link[type*='atom+xml'][href*='rss_token=#{user.rss_token}']", visible: false) end end shared_examples "it has an RSS button with current_user's RSS token" do it "shows the RSS button with current_user's RSS token" do - expect(page).to have_css("a:has(.fa-rss)[href*='rss_token=#{Thread.current[:current_user].rss_token}']") + expect(page).to have_css("a:has(.fa-rss)[href*='rss_token=#{user.rss_token}']") end end diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb index 99e7806353d9290b47982622e426b90bce4f0ace..b410a652126234621fac87ca39d08cfc114877f4 100644 --- a/spec/support/login_helpers.rb +++ b/spec/support/login_helpers.rb @@ -15,14 +15,16 @@ module LoginHelpers # user = create(:user) # gitlab_sign_in(user) def gitlab_sign_in(user_or_role, **kwargs) - @user = + user = if user_or_role.is_a?(User) user_or_role else create(user_or_role) end - gitlab_sign_in_with(@user, **kwargs) + gitlab_sign_in_with(user, **kwargs) + + user end def gitlab_sign_in_via(provider, user, uid) @@ -35,13 +37,8 @@ module LoginHelpers def gitlab_sign_out find(".header-user-dropdown-toggle").click click_link "Sign out" - # check the sign_in button - expect(page).to have_button('Sign in') - end - # Logout without JavaScript driver - def gitlab_sign_out_direct - page.driver.submit :delete, '/users/sign_out', {} + expect(page).to have_button('Sign in') end private @@ -58,8 +55,6 @@ module LoginHelpers check 'user_remember_me' if remember click_button "Sign in" - - Thread.current[:current_user] = user end def login_via(provider, user, uid, remember_me: false)