Commit 45fb1f95 authored by Robert Speicher's avatar Robert Speicher

Change `login_as` uses to `gitlab_sign_in`

parent c1cbc273
......@@ -4,7 +4,7 @@ feature 'Abuse reports', feature: true do
let(:another_user) { create(:user) }
before do
login_as :user
gitlab_sign_in :user
end
scenario 'Report abuse' do
......
......@@ -5,7 +5,7 @@ describe "Admin::AbuseReports", feature: true, js: true do
context 'as an admin' do
before do
login_as :admin
gitlab_sign_in :admin
end
describe 'if a user has been reported for abuse' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'admin active tab' do
before do
login_as :admin
gitlab_sign_in :admin
end
shared_examples 'page has active tab' do |title|
......
......@@ -4,7 +4,7 @@ feature 'Admin Appearance', feature: true do
let!(:appearance) { create(:appearance) }
scenario 'Create new appearance' do
login_as :admin
gitlab_sign_in :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
login_as :admin
gitlab_sign_in :admin
visit admin_appearances_path
click_link "Preview"
......@@ -34,7 +34,7 @@ feature 'Admin Appearance', feature: true do
end
scenario 'Appearance logo' do
login_as :admin
gitlab_sign_in :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
login_as :admin
gitlab_sign_in :admin
visit admin_appearances_path
attach_file(:appearance_header_logo, logo_fixture)
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Admin Broadcast Messages', feature: true do
before do
login_as :admin
gitlab_sign_in :admin
create(:broadcast_message, :expired, message: 'Migration to new server')
visit admin_broadcast_messages_path
end
......
......@@ -4,7 +4,7 @@ describe 'Admin browse spam logs' do
let!(:spam_log) { create(:spam_log, description: 'abcde ' * 20) }
before do
login_as :admin
gitlab_sign_in :admin
end
scenario 'Browse spam logs' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin browses logs' do
before do
login_as :admin
gitlab_sign_in :admin
end
it 'shows available log files' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin Builds' do
before do
login_as :admin
gitlab_sign_in :admin
end
describe 'GET /admin/builds' do
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Admin cohorts page', feature: true do
before do
login_as :admin
gitlab_sign_in :admin
end
scenario 'See users count per month' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin Conversational Development Index' do
before do
login_as :admin
gitlab_sign_in :admin
end
context 'when usage ping is disabled' do
......
......@@ -5,7 +5,7 @@ RSpec.describe 'admin deploy keys', type: :feature do
let!(:another_deploy_key) { create(:another_deploy_key, public: true) }
before do
login_as(:admin)
gitlab_sign_in(:admin)
end
it 'show all public deploy keys' do
......
......@@ -8,7 +8,7 @@ feature 'Admin disables Git access protocol', feature: true do
background do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
login_as(admin)
gitlab_sign_in(admin)
end
context 'with HTTP disabled' do
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Admin disables 2FA for a user', feature: true do
scenario 'successfully', js: true do
login_as(:admin)
gitlab_sign_in(: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
login_as(:admin)
gitlab_sign_in(:admin)
user = create(:user)
edit_user(user)
......
......@@ -6,7 +6,7 @@ feature 'Admin Groups', feature: true do
let(:internal) { Gitlab::VisibilityLevel::INTERNAL }
let(:user) { create :user }
let!(:group) { create :group }
let!(:current_user) { login_as :admin }
let!(:current_user) { gitlab_sign_in :admin }
before do
stub_application_setting(default_group_visibility: internal)
......
......@@ -5,7 +5,7 @@ feature "Admin Health Check", feature: true do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
login_as :admin
gitlab_sign_in :admin
end
describe '#show' do
......
......@@ -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
login_as :admin
gitlab_sign_in :admin
end
scenario 'show list of hook logs' do
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Admin::Hooks', feature: true do
before do
@project = create(:project)
login_as :admin
gitlab_sign_in :admin
@system_hook = create(:system_hook)
end
......
......@@ -5,7 +5,7 @@ RSpec.describe 'admin issues labels' do
let!(:feature_label) { Label.create(title: 'feature', template: true) }
before do
login_as :admin
gitlab_sign_in :admin
end
describe 'list' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'admin manage applications', feature: true do
before do
login_as :admin
gitlab_sign_in :admin
end
it do
......
......@@ -6,7 +6,7 @@ describe "Admin::Projects", feature: true do
let(:user) { create :user }
let!(:project) { create(:project) }
let!(:current_user) do
login_as :admin
gitlab_sign_in :admin
end
describe "GET /admin/projects" do
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Admin::RequestsProfilesController', feature: true do
before do
FileUtils.mkdir_p(Gitlab::RequestProfiler::PROFILES_DIR)
login_as(:admin)
gitlab_sign_in(:admin)
end
after do
......
......@@ -5,7 +5,7 @@ describe "Admin Runners" do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
login_as :admin
gitlab_sign_in :admin
end
describe "Runners page" do
......
......@@ -5,7 +5,7 @@ feature 'Admin updates settings', feature: true do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
login_as :admin
gitlab_sign_in :admin
visit admin_application_settings_path
end
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin System Info' do
before do
login_as :admin
gitlab_sign_in :admin
end
describe 'GET /admin/system_info' do
......
......@@ -13,7 +13,7 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do
end
before do
login_as(admin)
gitlab_sign_in(admin)
end
describe "token creation" do
......
......@@ -5,7 +5,7 @@ describe "Admin::Users", feature: true do
create(:omniauth_user, provider: 'twitter', extern_uid: '123456')
end
let!(:current_user) { login_as :admin }
let!(:current_user) { gitlab_sign_in :admin }
describe "GET /admin/users" do
before do
......
......@@ -5,7 +5,7 @@ feature 'Admin uses repository checks', feature: true do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
login_as :admin
gitlab_sign_in :admin
end
scenario 'to trigger a single check' do
......
......@@ -7,7 +7,7 @@ describe 'Auto deploy' do
before do
create :kubernetes_service, project: project
project.team << [user, :master]
login_as user
gitlab_sign_in user
end
context 'when no deployment service is active' do
......
......@@ -14,7 +14,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
before do
project.team << [user, :master]
login_as(user)
gitlab_sign_in(user)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
......
......@@ -12,7 +12,7 @@ describe 'Issue Boards', feature: true, js: true do
project.team << [user, :master]
project.team << [user2, :master]
login_as(user)
gitlab_sign_in(user)
end
context 'no lists' do
......@@ -543,7 +543,7 @@ describe 'Issue Boards', feature: true, js: true do
before do
project.team << [user_guest, :guest]
logout
login_as(user_guest)
gitlab_sign_in(user_guest)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
end
......
......@@ -15,7 +15,7 @@ describe 'Issue Boards', :feature, :js do
before do
project.team << [user, :master]
login_as(user)
gitlab_sign_in(user)
end
context 'un-ordered issues' do
......
......@@ -6,7 +6,7 @@ describe 'Issue Boards shortcut', feature: true, js: true do
before do
create(:board, project: project)
login_as :admin
gitlab_sign_in :admin
visit namespace_project_path(project.namespace, project)
end
......
......@@ -12,7 +12,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
before do
project.team << [user, :master]
login_as(user)
gitlab_sign_in(user)
end
it 'shows empty state when no results found' do
......
......@@ -10,7 +10,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
before do
project.team << [user, :master]
login_as(user)
gitlab_sign_in(user)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
......
......@@ -20,7 +20,7 @@ describe 'Issue Boards', feature: true, js: true do
project.team << [user, :master]
login_as(user)
gitlab_sign_in(user)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
......
......@@ -13,7 +13,7 @@ describe 'Sub-group project issue boards', :feature, :js do
before do
project.add_master(user)
login_as(user)
gitlab_sign_in(user)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
......
......@@ -68,7 +68,7 @@ feature 'Contributions Calendar', :feature, :js do
end
before do
login_as user
gitlab_sign_in user
end
describe 'calendar day selection' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'CI Lint', js: true do
before do
login_as :user
gitlab_sign_in :user
end
describe 'YAML parsing' do
......
......@@ -7,7 +7,7 @@ describe 'Commits' do
describe 'CI' do
before do
login_as :user
gitlab_sign_in :user
stub_ci_pipeline_to_return_yaml_file
end
......
......@@ -9,7 +9,7 @@ describe "Container Registry" do
end
before do
login_as(user)
gitlab_sign_in(user)
project.add_developer(user)
stub_container_registry_config(enabled: true)
stub_container_registry_tags(repository: :any, tags: [])
......
......@@ -6,7 +6,7 @@ describe 'Copy as GFM', feature: true, js: true do
include ActionView::Helpers::JavaScriptHelper
before do
login_as :admin
gitlab_sign_in :admin
end
describe 'Copying rendered GFM' do
......
......@@ -14,7 +14,7 @@ feature 'Cycle Analytics', feature: true, js: true do
before do
project.add_master(user)
login_as(user)
gitlab_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
login_as(user)
gitlab_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]
login_as(user)
gitlab_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
login_as(guest)
gitlab_sign_in(guest)
visit namespace_project_cycle_analytics_path(project.namespace, project)
wait_for_requests
end
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Active Tab', js: true, feature: true do
before do
login_as :user
gitlab_sign_in :user
end
shared_examples 'page has active tab' do |title|
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Activity', feature: true do
before do
login_as(create :user)
gitlab_sign_in(create :user)
visit activity_dashboard_path
end
......
......@@ -9,7 +9,7 @@ RSpec.describe 'Dashboard Archived Project', feature: true do
project.team << [user, :master]
archived_project.team << [user, :master]
login_as(user)
gitlab_sign_in(user)
visit dashboard_projects_path
end
......
......@@ -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)
login_as user
gitlab_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)
login_as user
gitlab_sign_in user
visit user_snippets_path(user)
wait_for_requests()
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Group', feature: true do
before do
login_as(:user)
gitlab_sign_in(:user)
end
it 'creates new group', js: true do
......
......@@ -10,7 +10,7 @@ describe 'Dashboard Groups page', js: true, feature: true do
group.add_owner(user)
nested_group.add_owner(user)
login_as(user)
gitlab_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)
login_as(user)
gitlab_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)
login_as(user)
gitlab_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)
login_as(user)
gitlab_sign_in(user)
visit dashboard_groups_path
end
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Help', feature: true do
before do
login_as(:user)
gitlab_sign_in(:user)
end
it 'renders correctly markdown' do
......
......@@ -9,7 +9,7 @@ describe 'Navigation bar counter', feature: true, caching: true do
before do
issue.assignees = [user]
merge_request.update(assignee: user)
login_as(user)
gitlab_sign_in(user)
end