diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-06-21 18:44:10 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-06-29 12:18:23 -0400 |
commit | e939bf7be10b6ec516ffbe75ad4b4dc1151670a7 (patch) | |
tree | 7d59f3f1fad2b83c1cd051562d6375fd4bbf0a7a /spec/features | |
parent | 5a983ac431affc800d5e9db9e83c14710ec29c36 (diff) | |
download | gitlab-ce-e939bf7be10b6ec516ffbe75ad4b4dc1151670a7.tar.gz |
Change gitlab_sign_in to sign_in where possible
Diffstat (limited to 'spec/features')
282 files changed, 385 insertions, 365 deletions
diff --git a/spec/features/abuse_report_spec.rb b/spec/features/abuse_report_spec.rb index b88e801c3d7..f26d3a6a72f 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 3a6e356b0b0..8672c009f90 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 c74336d8221..07430ecd6e0 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 d8fd4319328..1e2cb8569ec 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 da063bf7b74..e55308e393b 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 d9c4fc686b1..31d4142a8e9 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 c734a2ef16d..3e3404dfdac 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 e767081f3e5..e020579f71e 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 952e5475213..6840456e509 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 b484677a6df..2d2c7df5364 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 81cddd03f80..aaeaaa829e1 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 679bf63e0fd..1005fe86b3d 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 5437da29979..15dc6b6c234 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 8b0fafc5f07..d15d9982884 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 75093aa4167..c404e054dba 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 ec80c420c79..94dace7a1fd 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 c07c21bd6a1..1e675fc0ce7 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 bb40918bd22..ae9b47299e6 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 ae41267e5fc..2e04a82806f 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 a4ce3e1d5ee..f7426875244 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 2bfe401521b..bf0c21cd04a 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 6ad2d456b93..b06e7e5037c 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 2d6565e6d3b..e38c4263060 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 4efc7f0eb48..1fd1cda694a 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 231c094c91d..cd7040891e9 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 6dbc697642f..3bc8f8aed54 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 91d70435db8..68e0bf52de9 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 b94ad973fed..b3390da454d 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 namespace_project_issues_path(project.namespace, project, :atom) expect(response_headers['Content-Type']) diff --git a/spec/features/auto_deploy_spec.rb b/spec/features/auto_deploy_spec.rb index 74f5f70702a..e2c7a5f8530 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 ba58af22841..49fe19aa2a9 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 namespace_project_board_path(project.namespace, project, board) wait_for_requests diff --git a/spec/features/boards/boards_spec.rb b/spec/features/boards/boards_spec.rb index 87fc31d414c..8e15304e4dd 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 namespace_project_board_path(project.namespace, 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 namespace_project_board_path(project.namespace, 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 1e620061e5e..cb2f62368e6 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 ed3b38e6a7e..cb3df7fc9b1 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 namespace_project_path(project.namespace, project) end diff --git a/spec/features/boards/modal_filter_spec.rb b/spec/features/boards/modal_filter_spec.rb index 8899e1ef5e5..81cae33c367 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 77cd87d6601..8d808628dc2 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 namespace_project_board_path(project.namespace, project, board) wait_for_requests diff --git a/spec/features/boards/sidebar_spec.rb b/spec/features/boards/sidebar_spec.rb index 301c243febd..21cd5d0beb1 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 namespace_project_board_path(project.namespace, 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 d57ae6a71e7..155947e2ae0 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 namespace_project_board_path(project.namespace, project, board) wait_for_requests diff --git a/spec/features/calendar_spec.rb b/spec/features/calendar_spec.rb index b2e72fc7dee..adbd82e3057 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 de16ee3e567..af4cc00162a 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 80d16539d5a..878be31dfa5 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 005c88f6bab..93106c26aef 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 5a7ea975455..270f9492a74 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 namespace_project_cycle_analytics_path(project.namespace, 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 namespace_project_cycle_analytics_path(project.namespace, 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 namespace_project_cycle_analytics_path(project.namespace, 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 namespace_project_cycle_analytics_path(project.namespace, project) wait_for_requests end diff --git a/spec/features/dashboard/active_tab_spec.rb b/spec/features/dashboard/active_tab_spec.rb index f7ddded10c1..203d206b80b 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 1e9cabe7850..ebfe7340eb7 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 a5ba3e7e3cf..dda4d517e39 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 6931d0a840e..8949267c82e 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 2f7245950ec..ffaefb9c632 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 e520027bc38..54a01e837de 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 25b0f40c9cd..fa7ea4c96b6 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 8a8a20fd5b1..285724f4b48 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 a57962abbda..86ac24ea06e 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 88bbb9e75b9..8b7dacef913 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 b0e4036f27c..d06497041de 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 cc4193b180f..8340a4f59df 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 f29186f368d..0f5be9d78d3 100644 --- a/spec/features/dashboard/projects_spec.rb +++ b/spec/features/dashboard/projects_spec.rb @@ -7,7 +7,13 @@ RSpec.describe 'Dashboard Projects', feature: true 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 @@ -63,6 +69,4 @@ RSpec.describe 'Dashboard Projects', feature: true do expect(page).to have_xpath("//a[@href='#{pipelines_namespace_project_commit_path(project.namespace, 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 525b0e1b210..bb29dae1bdc 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 0c069ae5cf0..c5ae9aad9c6 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 5858f4aa101..d49a78b290f 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 e9f34760143..711d3617335 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 c4dbaad2895..f235fef1aa4 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 b308a2297b9..7a6a448d4c2 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 96128061e4d..0ee773b2d1e 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 namespace_project_commit_path(project.namespace, project, sample_commit.id) end diff --git a/spec/features/discussion_comments/issue_spec.rb b/spec/features/discussion_comments/issue_spec.rb index d7c1cd12fb5..0a1106e50c4 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 namespace_project_issue_path(project.namespace, project, issue) end diff --git a/spec/features/discussion_comments/merge_request_spec.rb b/spec/features/discussion_comments/merge_request_spec.rb index 31fb9c72d25..f51dc0c6f9c 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 namespace_project_merge_request_path(project.namespace, project, merge_request) end diff --git a/spec/features/discussion_comments/snippets_spec.rb b/spec/features/discussion_comments/snippets_spec.rb index 998d633c83d..aa7d575005f 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 namespace_project_snippet_path(project.namespace, project, snippet) end diff --git a/spec/features/expand_collapse_diffs_spec.rb b/spec/features/expand_collapse_diffs_spec.rb index ea749528c11..0f7ccafefb6 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 6be5dee0c3c..008d12714cc 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 2d7e703688f..86eba9b3b5c 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 54ebfe6cf77..efa5e95de89 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 9f66a3d8c72..262d9434ddf 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 b1c7151dfa8..e2c7907528b 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 f450626c370..ea779a3baf0 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 56e163ec4d0..f7ef7f29066 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 b33040ef843..88d104d5a06 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 f84d8594c65..51a4d769b9c 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 a9a654b20e2..4b226893701 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 41c31b62e18..3764e4792ca 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 8ee61953844..169827f5d0d 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 330310eae6b..bd5a8645609 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 76575f61528..cbf97d0674b 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 ecacca00a61..597da41bc95 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 b01ee1cf491..7fe65ee554d 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 f3a5a8463d1..8bd3728c9db 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 6698e2c79a1..24691ad7597 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 a1c97caea20..dc5b0c13a09 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 namespace_project_issue_path(project.namespace, 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 a99c19cb787..6a9107d1f86 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 namespace_project_issues_path(project.namespace, 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 aa538803dd8..7d1ad6a9827 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 5f631043e15..1828d76d019 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 namespace_project_merge_request_path(project.namespace, 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_namespace_project_issue_path(project.namespace, 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 9e9e214060f..e64db1a6cfe 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 namespace_project_merge_request_path(project.namespace, project, merge_request) end @@ -66,7 +66,7 @@ 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 + sign_in user visit new_namespace_project_issue_path(project.namespace, project, merge_request_to_resolve_discussions_of: merge_request.iid, discussion_to_resolve: discussion.id) diff --git a/spec/features/issues/filtered_search/dropdown_assignee_spec.rb b/spec/features/issues/filtered_search/dropdown_assignee_spec.rb index 96f6739af2d..ec06c7057a9 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 namespace_project_issues_path(project.namespace, project) diff --git a/spec/features/issues/filtered_search/dropdown_author_spec.rb b/spec/features/issues/filtered_search/dropdown_author_spec.rb index 5ee824c662a..29c939a0602 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 namespace_project_issues_path(project.namespace, project) diff --git a/spec/features/issues/filtered_search/dropdown_hint_spec.rb b/spec/features/issues/filtered_search/dropdown_hint_spec.rb index a05e4394ffd..d5611021bdf 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 namespace_project_issues_path(project.namespace, project) diff --git a/spec/features/issues/filtered_search/dropdown_label_spec.rb b/spec/features/issues/filtered_search/dropdown_label_spec.rb index aec9d7ceb5d..e77dd3a7b6f 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 namespace_project_issues_path(project.namespace, project) diff --git a/spec/features/issues/filtered_search/dropdown_milestone_spec.rb b/spec/features/issues/filtered_search/dropdown_milestone_spec.rb index b21f41946b7..3583a7dd3e7 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 namespace_project_issues_path(project.namespace, project) diff --git a/spec/features/issues/filtered_search/search_bar_spec.rb b/spec/features/issues/filtered_search/search_bar_spec.rb index 806c732b935..f0d6d05ad64 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 namespace_project_issues_path(project.namespace, project) diff --git a/spec/features/issues/filtered_search/visual_tokens_spec.rb b/spec/features/issues/filtered_search/visual_tokens_spec.rb index 22488f34813..ccef6afa1fe 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 namespace_project_issues_path(project.namespace, project) diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index b369ef1ff79..b1357c83ddd 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -16,7 +16,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 e61eb5233d0..8add439aac4 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 namespace_project_issue_path(project.namespace, project, issue) wait_for_requests diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb index 163bc4bb32f..573e4951935 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 66d823ec9d0..5486d123db2 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 namespace_project_issue_path(project.namespace, project, issue) end diff --git a/spec/features/issues/move_spec.rb b/spec/features/issues/move_spec.rb index 21a7637fe7f..490e00f8ab8 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 bd31e44ef33..05dd1172809 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 namespace_project_issue_path(project.namespace, 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 namespace_project_issue_path(project.namespace, 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 namespace_project_issue_path(project.namespace, project, issue) end diff --git a/spec/features/issues/notes_on_issues_spec.rb b/spec/features/issues/notes_on_issues_spec.rb index f648295416f..aa2c8d2a656 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 namespace_project_issue_path(project.namespace, 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 57c783790b5..a7992b462a9 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 a1c00dd64f6..20236deb934 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 namespace_project_issue_path(project.namespace, project, issue) end diff --git a/spec/features/issues/update_issues_spec.rb b/spec/features/issues/update_issues_spec.rb index dc981406e4e..4f0da927c63 100644 --- a/spec/features/issues/update_issues_spec.rb +++ b/spec/features/issues/update_issues_spec.rb @@ -7,7 +7,7 @@ feature 'Multiple issue updating from issues#index', feature: true do before do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) end context 'status', js: true do diff --git a/spec/features/issues/user_uses_slash_commands_spec.rb b/spec/features/issues/user_uses_slash_commands_spec.rb index 168cdd08137..d0a7a418208 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 namespace_project_issue_path(project.namespace, project, issue) end @@ -41,8 +41,8 @@ feature 'Issues > 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 namespace_project_issue_path(project.namespace, project, issue) end @@ -81,8 +81,8 @@ feature 'Issues > 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 namespace_project_issue_path(project.namespace, project, issue) end diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index f47b89fd718..e31b87d8e37 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_namespace_project_issue_path(project.namespace, project) diff --git a/spec/features/merge_requests/assign_issues_spec.rb b/spec/features/merge_requests/assign_issues_spec.rb index cb835f533e0..90410fcbc93 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 namespace_project_merge_request_path(project.namespace, project, merge_request) end diff --git a/spec/features/merge_requests/award_spec.rb b/spec/features/merge_requests/award_spec.rb index e9dd755b6af..7add201c587 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 namespace_project_merge_request_path(project.namespace, 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 060cfb8fdd1..be986d4304f 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 6ba96570e3d..7731f87cb78 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 365b2555c35..89c0cdbde37 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 namespace_project_merge_request_path(project.namespace, 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 9c091befa27..751799c15a7 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 namespace_project_merge_request_path(project.namespace, 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 6a08e50bf5e..3022a106d31 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 69059dfa562..2dd96a9b5f4 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 f2af3198319..bec14b41fb7 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 namespace_project_merge_request_path( diff --git a/spec/features/merge_requests/diff_notes_avatars_spec.rb b/spec/features/merge_requests/diff_notes_avatars_spec.rb index 989dfb71d10..62b6f2ec3c1 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 0f8ca6f90d1..617448a4547 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 cb6cd6571a8..bfcec08a730 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_namespace_project_merge_request_path(project.namespace, 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_namespace_project_merge_request_path(project.namespace, 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 88ae257236c..840f9968878 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 804bf6967d6..69f6933dbd0 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_namespace_project_merge_request_path(project.namespace, 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 9b677aeca0a..747afaf9de8 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 namespace_project_merge_requests_path(project.namespace, 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 79bca0c9de2..d2af150d852 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 c12edf1fdf3..cd7453b4f65 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 namespace_project_merge_requests_path(project.namespace, project) diff --git a/spec/features/merge_requests/form_spec.rb b/spec/features/merge_requests/form_spec.rb index d03d498ce21..7a665e868d4 100644 --- a/spec/features/merge_requests/form_spec.rb +++ b/spec/features/merge_requests/form_spec.rb @@ -18,7 +18,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 @@ -177,7 +177,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 27ba380b005..fbc5518b997 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 namespace_project_merge_request_path(project.namespace, 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 8af7d985036..8f1c0b4f7af 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 namespace_project_merge_request_path(merge_request.project.namespace, 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 bfadd7cb81a..60c3b30e55e 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 7664fbfbb4c..1285961ca96 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 5cd9a7fbe26..c1780541f43 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 c2241317e04..e4e1d60cff9 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 4328d66c748..33b954e6a25 100644 --- a/spec/features/merge_requests/target_branch_spec.rb +++ b/spec/features/merge_requests/target_branch_spec.rb @@ -13,7 +13,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 cba9a2cda99..b29eba5df88 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_namespace_project_merge_request_path(project.namespace, project, merge_request) diff --git a/spec/features/merge_requests/toggler_behavior_spec.rb b/spec/features/merge_requests/toggler_behavior_spec.rb index c4c06e9a7a0..eb4ea3f3886 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 "#{namespace_project_merge_request_path(project.namespace, 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 d0418c74699..af9fda412af 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 ac7e0eb2727..429aafe036a 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 12f987e12ea..fa2d662bda3 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 namespace_project_merge_request_path(project.namespace, 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 0d88a8172b0..04919cde939 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 a1f123f15ec..92bbd56cee9 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 namespace_project_merge_request_path(project.namespace, 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 namespace_project_merge_request_path(project.namespace, 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 namespace_project_merge_request_path(project.namespace, 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 namespace_project_merge_request_path(project.namespace, project, merge_request) end diff --git a/spec/features/merge_requests/versions_spec.rb b/spec/features/merge_requests/versions_spec.rb index 04a72d3be34..5c41c859e2e 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_namespace_project_merge_request_path(project.namespace, 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 e82e69c5f4a..68a5b4dea0e 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 namespace_project_merge_request_path(project.namespace, project, merge_request) end diff --git a/spec/features/merge_requests/widget_spec.rb b/spec/features/merge_requests/widget_spec.rb index d8e9b949204..9f3d47e52c5 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 @@ -209,8 +209,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 namespace_project_merge_request_path(project.namespace, 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 0e304ba50af..51df08a1728 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 diff --git a/spec/features/milestone_spec.rb b/spec/features/milestone_spec.rb index 58989581ffe..3b96f94eee4 100644 --- a/spec/features/milestone_spec.rb +++ b/spec/features/milestone_spec.rb @@ -6,7 +6,7 @@ feature 'Milestone', feature: true do before do 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 cdf6cfba402..78e2664dc0c 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 b8966cf621c..62eb779eeeb 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 bb4263d83f3..fae11a993b5 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 33fd29b429b..9d782ecf63b 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 1a162d6be0e..e4c236f4c68 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 13f9afd4ce0..9439a258a75 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 a6f9beafe17..c7886421c83 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 86c9df5ff86..67975a68ee2 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 d7acaaf1eb8..44b7ee101c9 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 8e7ef6bc110..65fed82c256 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 c0092836e3b..75daef0c38c 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 84c81d43448..7333c465ae0 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_namespace_project_path(project.namespace, 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 9624e1a71b0..aabff1153ef 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 348748152bb..37f5ef9cd67 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 namespace_project_pipelines_settings_path(project.namespace, project) end diff --git a/spec/features/projects/blobs/edit_spec.rb b/spec/features/projects/blobs/edit_spec.rb index d0bc032ee93..c6061f220c4 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 namespace_project_edit_blob_path(project.namespace, 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 d8c4d475a2c..ba4986e9477 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 406fa52e723..2bd5bdcdd8b 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_namespace_project_branch_path(project.namespace, project) end diff --git a/spec/features/projects/commit/builds_spec.rb b/spec/features/projects/commit/builds_spec.rb index e5b1f95f2b9..3e679dadd3b 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 570a7ae7b16..d259bdbc28a 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 f7548a56984..96e030d78b9 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) { namespace_project_commits_path(project.namespace, 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 4743d69fb75..e609653bd5f 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 namespace_project_compare_index_path(project.namespace, 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 a31960639fe..a9db3046287 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 a943f1e6a08..f77fd612065 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 ca202b95a44..09bc1d9fa3e 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_namespace_project_path(project.namespace, project) end diff --git a/spec/features/projects/environments/environment_metrics_spec.rb b/spec/features/projects/environments/environment_metrics_spec.rb index a98a69a0fd6..7c10b0b3480 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 7d565555f1f..73888ecbfaa 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 cf4d996a32d..169b3caac9a 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 db2790a4bce..ac069431585 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_namespace_project_path(project.namespace, 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 namespace_project_path(project.namespace, project) end diff --git a/spec/features/projects/files/browse_files_spec.rb b/spec/features/projects/files/browse_files_spec.rb index 34aef958ec6..3a13ca540d3 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 namespace_project_tree_path(project.namespace, 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 2a1cc01fe68..c2618e0e664 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 namespace_project_new_blob_path(project.namespace, 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 4f1b8588462..63fed83c525 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 namespace_project_new_blob_path(project.namespace, 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 60182bfebe9..8c20498f3a8 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 6e361ac4312..910e3909b50 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 namespace_project_new_blob_path(project.namespace, 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 e97ff5fded7..8f43bf4ef7f 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 namespace_project_edit_blob_path(project.namespace, 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 83a837fba44..955fc97dae7 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 namespace_project_tree_path(project.namespace, 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 6a914820ac9..4bdca0c9293 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 namespace_project_find_file_path(project.namespace, 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 166ec5c921b..6df53124f17 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 7f02ec6b73d..a75c4c7beb5 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 namespace_project_new_blob_path(project.namespace, 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 f4b17c2518c..e9ade9f8678 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 namespace_project_new_blob_path(project.namespace, 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 7daf016dd22..b3c4d939342 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 namespace_project_path(project.namespace, 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 eab19d52030..a428b05b4f5 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 028a0919640..90aee4b4272 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 4ccd123f46e..366e3848c68 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 aa4ed217a34..2303b9b6199 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 namespace_project_path(project.namespace, project) end diff --git a/spec/features/projects/group_links_spec.rb b/spec/features/projects/group_links_spec.rb index 778f5d61ae3..d94f0531d81 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 e1f7f06c113..07fa8a5d745 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 b5c64777934..d5180964bdf 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 a111aa87c52..abee3194066 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 b0a68f0d61f..0a085393dda 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 26a09985312..59170e32473 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,17 +124,21 @@ 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', template_content, message: 'added merge request template', branch_name: 'master') + visit edit_namespace_project_merge_request_path project.namespace, project, merge_request fill_in :'merge_request[title]', with: 'test merge request title' end diff --git a/spec/features/projects/issues/list_spec.rb b/spec/features/projects/issues/list_spec.rb index b2db07a75ef..e1b53124008 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 38733d39932..a6299591e6f 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 070cdbf1cef..006a5011a2e 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -17,7 +17,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 @@ -393,7 +393,7 @@ feature 'Jobs', :feature do project.update(visibility_level: Gitlab::VisibilityLevel::PUBLIC) gitlab_sign_out_direct - gitlab_sign_in(create(:user)) + sign_in(create(:user)) visit namespace_project_job_path(project.namespace, 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 2c47758f30e..76beb4c1a0d 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 namespace_project_issues_path(project.namespace, 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 namespace_project_issues_path(project.namespace, 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 584dc294f05..0ee8553b6c8 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 589bfb9fbc9..3e3c1abcb3c 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 namespace_project_labels_path(project.namespace, project) diff --git a/spec/features/projects/main/download_buttons_spec.rb b/spec/features/projects/main/download_buttons_spec.rb index 514453db472..a4eb1c39eec 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 fee8cfe2c33..23c1c22f029 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) { namespace_project_path(project.namespace, 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 00d2a27597b..7e0e7ff27bd 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 namespace_project_settings_members_path(project.namespace, 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 7e71dbc24c0..055f2551f87 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 namespace_project_path(project.namespace, 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 60a5cd9ec63..3a8c6c0a504 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 namespace_project_path(project.namespace, project) end end diff --git a/spec/features/projects/members/group_members_spec.rb b/spec/features/projects/members/group_members_spec.rb index 76fe6a00dab..f3359215126 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 66da28b07fe..63b2acb8127 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 namespace_project_path(project.namespace, project) diff --git a/spec/features/projects/members/list_spec.rb b/spec/features/projects/members/list_spec.rb index 9fdd7df0ee5..cf0442eb919 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 21b48b7fdd1..1dec1508dc6 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 bd445e27243..8040af68bfc 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 703f5dff6b5..a4eaf1cc4a6 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 namespace_project_path(project.namespace, 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 8e1788f7f2a..f55522239de 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 namespace_project_path(project.namespace, 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 70e4bb19c0f..7532f85fc22 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 namespace_project_path(project.namespace, 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 0cd7e3afeda..63c23c835ab 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 namespace_project_path(project.namespace, project) end diff --git a/spec/features/projects/members/sorting_spec.rb b/spec/features/projects/members/sorting_spec.rb index 66d98ef8b90..d832437cc32 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 081009f2325..2bf078e7965 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 namespace_project_path(project.namespace, project) end diff --git a/spec/features/projects/merge_request_button_spec.rb b/spec/features/projects/merge_request_button_spec.rb index 58054bbbbed..e8ab482a6e1 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 @@ -52,7 +52,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 7ce3156215a..855327ec303 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 a02e4118784..407cc5823cb 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 2350089255d..1b33aed1606 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/new_project_spec.rb b/spec/features/projects/new_project_spec.rb index 37d9a97033b..c1ad1551e1f 100644 --- a/spec/features/projects/new_project_spec.rb +++ b/spec/features/projects/new_project_spec.rb @@ -4,7 +4,7 @@ feature "New project", feature: true do let(:user) { create(:admin) } before do - gitlab_sign_in(user) + sign_in(user) end context "Visibility level selector" do diff --git a/spec/features/projects/pages_spec.rb b/spec/features/projects/pages_spec.rb index e9a3cfb7f60..011c54e0be8 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 dfb973c37e5..00c9029545b 100644 --- a/spec/features/projects/pipeline_schedules_spec.rb +++ b/spec/features/projects/pipeline_schedules_spec.rb @@ -12,7 +12,7 @@ feature 'Pipeline Schedules', :feature do before do project.add_master(user) - gitlab_sign_in(user) + sign_in(user) visit_page end diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index e182995922d..6372de00b00 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -7,7 +7,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 d36d073e022..c25c8aabaea 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 baa38ff8cca..2710a4cf271 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 016a992bdcf..28b98d70cdc 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 namespace_project_tree_path(project.namespace, project, 'master') end diff --git a/spec/features/projects/services/jira_service_spec.rb b/spec/features/projects/services/jira_service_spec.rb index 8cd216c8fdb..fdd2e8b91ec 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 namespace_project_settings_integrations_path(project.namespace, 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 d87985f1c92..4239d39e8d6 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_namespace_project_service_path(project.namespace, project, service) end diff --git a/spec/features/projects/services/slack_service_spec.rb b/spec/features/projects/services/slack_service_spec.rb index 50707e6a49f..8ba7bbaa007 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 3fae38c1799..87b733880e1 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_namespace_project_service_path(project.namespace, project, service) end diff --git a/spec/features/projects/settings/integration_settings_spec.rb b/spec/features/projects/settings/integration_settings_spec.rb index a59374b37ea..d59b4c821eb 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) { namespace_project_settings_integrations_path(project.namespace, 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 f2af14ceab2..2689bcedd74 100644 --- a/spec/features/projects/settings/merge_requests_settings_spec.rb +++ b/spec/features/projects/settings/merge_requests_settings_spec.rb @@ -8,7 +8,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 c33fbd49d21..73ca839a0b8 100644 --- a/spec/features/projects/settings/pipelines_settings_spec.rb +++ b/spec/features/projects/settings/pipelines_settings_spec.rb @@ -8,7 +8,7 @@ feature "Pipelines settings", feature: true do let(:role) { :developer } background do - gitlab_sign_in(user) + sign_in(user) project.team << [user, role] visit namespace_project_pipelines_settings_path(project.namespace, project) end diff --git a/spec/features/projects/settings/repository_settings_spec.rb b/spec/features/projects/settings/repository_settings_spec.rb index 35cd0d6e832..29c0adf5823 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 18c71dee41b..28380a82e7d 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_namespace_project_path(project.namespace, 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_namespace_project_path(project.namespace, project) end diff --git a/spec/features/projects/shortcuts_spec.rb b/spec/features/projects/shortcuts_spec.rb index cec79277c33..6969cf29458 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 namespace_project_path(project.namespace, project) end diff --git a/spec/features/projects/snippets/create_snippet_spec.rb b/spec/features/projects/snippets/create_snippet_spec.rb index c75d6dbc307..978d934e752 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 namespace_project_snippets_path(project.namespace, project) diff --git a/spec/features/projects/snippets/show_spec.rb b/spec/features/projects/snippets/show_spec.rb index 9e73ba4123b..32353aeb357 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 80dbffaffc7..7d823d9ba21 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 namespace_project_snippet_path(project.namespace, 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 63eb97d5a92..be087995a83 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 ca00a51aa3c..a70beb9cbed 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 135584e5bf8..0c3ec1099f0 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) { namespace_project_tree_path(project.namespace, 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 5d0acad3832..71b002f4e52 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 namespace_project_tree_path(project.namespace, 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 f6a640b90b4..47fcbf91a8e 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_namespace_project_merge_request_path(project.namespace, 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 namespace_project_compare_path(project.namespace, 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 namespace_project_compare_path(project.namespace, 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 namespace_project_blob_path(project.namespace, 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 namespace_project_blob_path(project.namespace, 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 namespace_project_commit_path(project.namespace, project, sha) diff --git a/spec/features/projects/wiki/markdown_preview_spec.rb b/spec/features/projects/wiki/markdown_preview_spec.rb index fd6c09943e3..98fcb062127 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 namespace_project_path(project.namespace, 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 ab0ed9b8204..c888d01a346 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 namespace_project_wiki_path(project.namespace, project, wiki_page) end diff --git a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb index a477dcf7ee9..da29b2a10e7 100644 --- a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb @@ -5,7 +5,7 @@ feature 'Projects > Wiki > User creates wiki page', js: true, feature: true do background do project.team << [user, :master] - gitlab_sign_in(user) + sign_in(user) visit namespace_project_path(project.namespace, project) find('.shortcuts-wiki').trigger('click') 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 7d31122af35..c112c4d6ad3 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 64a30438681..7f5681e0454 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 namespace_project_wikis_path(project.namespace, 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 8a88ab247f3..b75b151a8a8 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 36799925167..4573c713a29 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 7e8a703db93..11882b08056 100644 --- a/spec/features/projects_spec.rb +++ b/spec/features/projects_spec.rb @@ -6,7 +6,7 @@ feature 'Project', feature: true do let(:path) { namespace_project_path(project.namespace, 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_namespace_project_path(project.namespace, 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_namespace_project_path(project.namespace, 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 namespace_project_path(project.namespace, 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 namespace_project_issue_path(project.namespace, 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 namespace_project_path(project.namespace, project) end diff --git a/spec/features/protected_branches_spec.rb b/spec/features/protected_branches_spec.rb index 20b8e10f0f7..2762f888e97 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 73a80692154..4dd59b5ad2e 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 12049822753..4b307f6ad69 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 ca2a7f41496..ed6ed76bb55 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 namespace_project_issue_path(project.namespace, project, issue) end diff --git a/spec/features/reportable_note/merge_request_spec.rb b/spec/features/reportable_note/merge_request_spec.rb index 8e75b4af3eb..178164c5902 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 namespace_project_merge_request_path(project.namespace, project, merge_request) end diff --git a/spec/features/reportable_note/snippets_spec.rb b/spec/features/reportable_note/snippets_spec.rb index 5bee4a31379..d20d12abe84 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 ea18879b4bf..07eddff08c3 100644 --- a/spec/features/runners_spec.rb +++ b/spec/features/runners_spec.rb @@ -6,7 +6,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 64469f999af..7c3081445d1 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/create_snippet_spec.rb b/spec/features/snippets/create_snippet_spec.rb index ac5c14ed427..dd0dd5934c2 100644 --- a/spec/features/snippets/create_snippet_spec.rb +++ b/spec/features/snippets/create_snippet_spec.rb @@ -4,7 +4,7 @@ feature 'Create Snippet', :js, feature: true do include DropzoneHelper before do - gitlab_sign_in :user + sign_in(create(:user)) visit new_snippet_path end diff --git a/spec/features/snippets/edit_snippet_spec.rb b/spec/features/snippets/edit_snippet_spec.rb index 860e1b156d6..b4b94b8be5e 100644 --- a/spec/features/snippets/edit_snippet_spec.rb +++ b/spec/features/snippets/edit_snippet_spec.rb @@ -10,7 +10,7 @@ feature 'Edit Snippet', :js, feature: true do let(:snippet) { create(:personal_snippet, :public, file_name: file_name, content: content, author: user) } before do - gitlab_sign_in(user) + sign_in(user) visit edit_snippet_path(snippet) wait_for_requests diff --git a/spec/features/snippets/explore_spec.rb b/spec/features/snippets/explore_spec.rb index ec75817b942..97d1c2d65e6 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 3babb1c02cc..fb3e75f2102 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 c7e2e3d8a34..17e93209f0c 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 4c21e7321f4..5483df39a8b 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 b971c6aab53..019310f2326 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 52db3583dac..e575456c083 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 58f33e954f9..78e54476933 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 namespace_project_tags_path(project.namespace, project) end diff --git a/spec/features/tags/master_updates_tag_spec.rb b/spec/features/tags/master_updates_tag_spec.rb index 18c8c4c511c..5b5ffda031e 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 namespace_project_tags_path(project.namespace, project) end diff --git a/spec/features/tags/master_views_tags_spec.rb b/spec/features/tags/master_views_tags_spec.rb index 3c21fa06694..09bfc0b790b 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 797b7b3d50d..32784de1613 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 a3f8027f4da..82c356735b9 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 77a1012762d..783377cbb78 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 namespace_project_issue_path(project.namespace, project, issue) end diff --git a/spec/features/user_callout_spec.rb b/spec/features/user_callout_spec.rb index 7538a6e4a04..93768aa46df 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 1bd7e038939..4182882bb45 100644 --- a/spec/features/user_can_display_performance_bar_spec.rb +++ b/spec/features/user_can_display_performance_bar_spec.rb @@ -57,7 +57,7 @@ describe 'User can display performacne bar', :js do context 'when user is logged-in' do before do - gitlab_sign_in(create(:user)) + sign_in(create(:user)) visit root_path end diff --git a/spec/features/users/projects_spec.rb b/spec/features/users/projects_spec.rb index 377b1a0148f..797ed0e6437 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 797b317a9bb..7c5abe54d56 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 74c5cbd7887..42738b137af 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 85085bf305a..edcc2df50c0 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 |