Commit e939bf7b authored by Robert Speicher's avatar Robert Speicher

Change gitlab_sign_in to sign_in where possible

parent 5a983ac4
......@@ -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
......
......@@ -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
......
......@@ -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|
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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'])
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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: [])
......
......@@ -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
......
......@@ -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
......
......@@ -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|
......
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
......
......@@ -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
......
......@@ -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()
......
......@@ -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
......
......@@ -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)