Commit cf3f89fd authored by Douwe Maan's avatar Douwe Maan

Merge branch 'rs-gitlab_sign_in-ee' into 'master'

[EE] Prepare for bypassing GitLab sign in in feature specs

See merge request !2140
parents 786edf41 566bc86b
...@@ -4,7 +4,7 @@ feature 'Abuse reports', feature: true do ...@@ -4,7 +4,7 @@ feature 'Abuse reports', feature: true do
let(:another_user) { create(:user) } let(:another_user) { create(:user) }
before do before do
login_as :user gitlab_sign_in :user
end end
scenario 'Report abuse' do scenario 'Report abuse' do
......
...@@ -5,7 +5,7 @@ describe "Admin::AbuseReports", feature: true, js: true do ...@@ -5,7 +5,7 @@ describe "Admin::AbuseReports", feature: true, js: true do
context 'as an admin' do context 'as an admin' do
before do before do
login_as :admin gitlab_sign_in :admin
end end
describe 'if a user has been reported for abuse' do describe 'if a user has been reported for abuse' do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'admin active tab' do RSpec.describe 'admin active tab' do
before do before do
login_as :admin gitlab_sign_in :admin
end end
shared_examples 'page has active tab' do |title| shared_examples 'page has active tab' do |title|
......
...@@ -4,7 +4,7 @@ feature 'Admin Appearance', feature: true do ...@@ -4,7 +4,7 @@ feature 'Admin Appearance', feature: true do
let!(:appearance) { create(:appearance) } let!(:appearance) { create(:appearance) }
scenario 'Create new appearance' do scenario 'Create new appearance' do
login_as :admin gitlab_sign_in :admin
visit admin_appearances_path visit admin_appearances_path
fill_in 'appearance_title', with: 'MyCompany' fill_in 'appearance_title', with: 'MyCompany'
...@@ -20,7 +20,7 @@ feature 'Admin Appearance', feature: true do ...@@ -20,7 +20,7 @@ feature 'Admin Appearance', feature: true do
end end
scenario 'Preview appearance' do scenario 'Preview appearance' do
login_as :admin gitlab_sign_in :admin
visit admin_appearances_path visit admin_appearances_path
click_link "Preview" click_link "Preview"
...@@ -34,7 +34,7 @@ feature 'Admin Appearance', feature: true do ...@@ -34,7 +34,7 @@ feature 'Admin Appearance', feature: true do
end end
scenario 'Appearance logo' do scenario 'Appearance logo' do
login_as :admin gitlab_sign_in :admin
visit admin_appearances_path visit admin_appearances_path
attach_file(:appearance_logo, logo_fixture) attach_file(:appearance_logo, logo_fixture)
...@@ -46,7 +46,7 @@ feature 'Admin Appearance', feature: true do ...@@ -46,7 +46,7 @@ feature 'Admin Appearance', feature: true do
end end
scenario 'Header logos' do scenario 'Header logos' do
login_as :admin gitlab_sign_in :admin
visit admin_appearances_path visit admin_appearances_path
attach_file(:appearance_header_logo, logo_fixture) attach_file(:appearance_header_logo, logo_fixture)
......
...@@ -6,7 +6,7 @@ describe 'Admin::AuditLogs', feature: true, js: true do ...@@ -6,7 +6,7 @@ describe 'Admin::AuditLogs', feature: true, js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
login_as :admin gitlab_sign_in :admin
end end
describe 'user events' do describe 'user events' do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Admin Broadcast Messages', feature: true do feature 'Admin Broadcast Messages', feature: true do
before do before do
login_as :admin gitlab_sign_in :admin
create(:broadcast_message, :expired, message: 'Migration to new server') create(:broadcast_message, :expired, message: 'Migration to new server')
visit admin_broadcast_messages_path visit admin_broadcast_messages_path
end end
......
...@@ -4,7 +4,7 @@ describe 'Admin browse spam logs' do ...@@ -4,7 +4,7 @@ describe 'Admin browse spam logs' do
let!(:spam_log) { create(:spam_log, description: 'abcde ' * 20) } let!(:spam_log) { create(:spam_log, description: 'abcde ' * 20) }
before do before do
login_as :admin gitlab_sign_in :admin
end end
scenario 'Browse spam logs' do scenario 'Browse spam logs' do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin browses logs' do describe 'Admin browses logs' do
before do before do
login_as :admin gitlab_sign_in :admin
end end
it 'shows available log files' do it 'shows available log files' do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin Builds' do describe 'Admin Builds' do
before do before do
login_as :admin gitlab_sign_in :admin
end end
describe 'GET /admin/builds' do describe 'GET /admin/builds' do
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Admin cohorts page', feature: true do feature 'Admin cohorts page', feature: true do
before do before do
login_as :admin gitlab_sign_in :admin
end end
scenario 'See users count per month' do scenario 'See users count per month' do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin Conversational Development Index' do describe 'Admin Conversational Development Index' do
before do before do
login_as :admin gitlab_sign_in :admin
end end
context 'when usage ping is disabled' do context 'when usage ping is disabled' do
......
...@@ -5,7 +5,7 @@ RSpec.describe 'admin deploy keys', type: :feature do ...@@ -5,7 +5,7 @@ RSpec.describe 'admin deploy keys', type: :feature do
let!(:another_deploy_key) { create(:another_deploy_key, public: true) } let!(:another_deploy_key) { create(:another_deploy_key, public: true) }
before do before do
login_as(:admin) gitlab_sign_in(:admin)
end end
it 'show all public deploy keys' do it 'show all public deploy keys' do
......
...@@ -8,7 +8,7 @@ feature 'Admin disables Git access protocol', feature: true do ...@@ -8,7 +8,7 @@ feature 'Admin disables Git access protocol', feature: true do
background do background do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
login_as(admin) gitlab_sign_in(admin)
end end
context 'with HTTP disabled' do context 'with HTTP disabled' do
......
...@@ -2,7 +2,7 @@ require 'rails_helper' ...@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Admin disables 2FA for a user', feature: true do feature 'Admin disables 2FA for a user', feature: true do
scenario 'successfully', js: true do scenario 'successfully', js: true do
login_as(:admin) gitlab_sign_in(:admin)
user = create(:user, :two_factor) user = create(:user, :two_factor)
edit_user(user) edit_user(user)
...@@ -17,7 +17,7 @@ feature 'Admin disables 2FA for a user', feature: true do ...@@ -17,7 +17,7 @@ feature 'Admin disables 2FA for a user', feature: true do
end end
scenario 'for a user without 2FA enabled' do scenario 'for a user without 2FA enabled' do
login_as(:admin) gitlab_sign_in(:admin)
user = create(:user) user = create(:user)
edit_user(user) edit_user(user)
......
require 'spec_helper' require 'spec_helper'
describe "Admin::Emails", feature: true, js: true do describe "Admin::Emails", feature: true, js: true do
let!(:current_user) { login_as :admin } let!(:current_user) { gitlab_sign_in :admin }
let!(:group) { create(:group) } let!(:group) { create(:group) }
let!(:project) { create(:project, namespace: group) } let!(:project) { create(:project, namespace: group) }
......
...@@ -6,7 +6,7 @@ feature 'Admin Groups', feature: true do ...@@ -6,7 +6,7 @@ feature 'Admin Groups', feature: true do
let(:internal) { Gitlab::VisibilityLevel::INTERNAL } let(:internal) { Gitlab::VisibilityLevel::INTERNAL }
let(:user) { create :user } let(:user) { create :user }
let!(:group) { create :group } let!(:group) { create :group }
let!(:current_user) { login_as :admin } let!(:current_user) { gitlab_sign_in :admin }
before do before do
stub_application_setting(default_group_visibility: internal) stub_application_setting(default_group_visibility: internal)
......
...@@ -5,7 +5,7 @@ feature "Admin Health Check", feature: true do ...@@ -5,7 +5,7 @@ feature "Admin Health Check", feature: true do
before do before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
login_as :admin gitlab_sign_in :admin
end end
describe '#show' do describe '#show' do
......
...@@ -6,7 +6,7 @@ feature 'Admin::HookLogs', feature: true 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') } let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') }
before do before do
login_as :admin gitlab_sign_in :admin
end end
scenario 'show list of hook logs' do scenario 'show list of hook logs' do
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Admin::Hooks', feature: true do describe 'Admin::Hooks', feature: true do
before do before do
@project = create(:project) @project = create(:project)
login_as :admin gitlab_sign_in :admin
@system_hook = create(:system_hook) @system_hook = create(:system_hook)
end end
......
...@@ -5,7 +5,7 @@ RSpec.describe 'admin issues labels' do ...@@ -5,7 +5,7 @@ RSpec.describe 'admin issues labels' do
let!(:feature_label) { Label.create(title: 'feature', template: true) } let!(:feature_label) { Label.create(title: 'feature', template: true) }
before do before do
login_as :admin gitlab_sign_in :admin
end end
describe 'list' do describe 'list' do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature "License Admin", feature: true do feature "License Admin", feature: true do
before do before do
login_as :admin gitlab_sign_in :admin
end end
describe '#show' do describe '#show' do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'admin manage applications', feature: true do RSpec.describe 'admin manage applications', feature: true do
before do before do
login_as :admin gitlab_sign_in :admin
end end
it do it do
......
...@@ -6,7 +6,7 @@ describe "Admin::Projects", feature: true do ...@@ -6,7 +6,7 @@ describe "Admin::Projects", feature: true do
let(:user) { create :user } let(:user) { create :user }
let!(:project) { create(:project) } let!(:project) { create(:project) }
let!(:current_user) do let!(:current_user) do
login_as :admin gitlab_sign_in :admin
end end
describe "GET /admin/projects" do describe "GET /admin/projects" do
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Admin::RequestsProfilesController', feature: true do describe 'Admin::RequestsProfilesController', feature: true do
before do before do
FileUtils.mkdir_p(Gitlab::RequestProfiler::PROFILES_DIR) FileUtils.mkdir_p(Gitlab::RequestProfiler::PROFILES_DIR)
login_as(:admin) gitlab_sign_in(:admin)
end end
after do after do
......
...@@ -5,7 +5,7 @@ describe "Admin Runners" do ...@@ -5,7 +5,7 @@ describe "Admin Runners" do
before do before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
login_as :admin gitlab_sign_in :admin
end end
describe "Runners page" do describe "Runners page" do
......
...@@ -5,7 +5,7 @@ feature 'Admin updates settings', feature: true do ...@@ -5,7 +5,7 @@ feature 'Admin updates settings', feature: true do
before do before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
login_as :admin gitlab_sign_in :admin
visit admin_application_settings_path visit admin_application_settings_path
end end
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin System Info' do describe 'Admin System Info' do
before do before do
login_as :admin gitlab_sign_in :admin
end end
describe 'GET /admin/system_info' do describe 'GET /admin/system_info' do
......
...@@ -13,7 +13,7 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do ...@@ -13,7 +13,7 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do
end end
before do before do
login_as(admin) gitlab_sign_in(admin)
end end
describe "token creation" do describe "token creation" do
......
...@@ -5,7 +5,7 @@ describe "Admin::Users", feature: true do ...@@ -5,7 +5,7 @@ describe "Admin::Users", feature: true do
create(:omniauth_user, provider: 'twitter', extern_uid: '123456') create(:omniauth_user, provider: 'twitter', extern_uid: '123456')
end end
let!(:current_user) { login_as :admin } let!(:current_user) { gitlab_sign_in :admin }
describe "GET /admin/users" do describe "GET /admin/users" do
before do before do
......
...@@ -5,7 +5,7 @@ feature 'Admin uses repository checks', feature: true do ...@@ -5,7 +5,7 @@ feature 'Admin uses repository checks', feature: true do
before do before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
login_as :admin gitlab_sign_in :admin
end end
scenario 'to trigger a single check' do scenario 'to trigger a single check' do
......
...@@ -15,7 +15,7 @@ describe 'Issues Feed', feature: true do ...@@ -15,7 +15,7 @@ describe 'Issues Feed', feature: true do
context 'when authenticated' do context 'when authenticated' do
it 'renders atom feed' do it 'renders atom feed' do
login_with user gitlab_sign_in user
visit namespace_project_issues_path(project.namespace, project, :atom) visit namespace_project_issues_path(project.namespace, project, :atom)
expect(response_headers['Content-Type']). expect(response_headers['Content-Type']).
......
...@@ -7,7 +7,7 @@ describe 'Auto deploy' do ...@@ -7,7 +7,7 @@ describe 'Auto deploy' do
before do before do
create :kubernetes_service, project: project create :kubernetes_service, project: project
project.team << [user, :master] project.team << [user, :master]
login_as user gitlab_sign_in user
end end
context 'when no deployment service is active' do context 'when no deployment service is active' do
......
...@@ -14,7 +14,7 @@ describe 'Issue Boards add issue modal', :feature, :js do ...@@ -14,7 +14,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
before do before do
project.team << [user, :master] project.team << [user, :master]
login_as(user) gitlab_sign_in(user)
visit namespace_project_board_path(project.namespace, project, board) visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests wait_for_requests
......
...@@ -10,7 +10,7 @@ describe 'Board with milestone', :feature, :js do ...@@ -10,7 +10,7 @@ describe 'Board with milestone', :feature, :js do
before do before do
project.team << [user, :master] project.team << [user, :master]
login_as(user) gitlab_sign_in(user)
end end
context 'new board' do context 'new board' do
......
...@@ -14,7 +14,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -14,7 +14,7 @@ describe 'Issue Boards', feature: true, js: true do
project.team << [user, :master] project.team << [user, :master]
project.team << [user2, :master] project.team << [user2, :master]
login_as(user) gitlab_sign_in(user)
end end
context 'no lists' do context 'no lists' do
...@@ -537,7 +537,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -537,7 +537,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'signed out user' do context 'signed out user' do
before do before do
logout gitlab_sign_out
visit namespace_project_boards_path(project.namespace, project) visit namespace_project_boards_path(project.namespace, project)
wait_for_requests wait_for_requests
end end
...@@ -560,8 +560,8 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -560,8 +560,8 @@ describe 'Issue Boards', feature: true, js: true do
before do before do
project.team << [user_guest, :guest] project.team << [user_guest, :guest]
logout gitlab_sign_out
login_as(user_guest) gitlab_sign_in(user_guest)
visit namespace_project_boards_path(project.namespace, project) visit namespace_project_boards_path(project.namespace, project)
wait_for_requests wait_for_requests
end end
......
...@@ -15,7 +15,7 @@ describe 'Issue Boards', :feature, :js do ...@@ -15,7 +15,7 @@ describe 'Issue Boards', :feature, :js do
before do before do
project.team << [user, :master] project.team << [user, :master]
login_as(user) gitlab_sign_in(user)
end end
context 'un-ordered issues' do context 'un-ordered issues' do
......
...@@ -6,7 +6,7 @@ describe 'Issue Boards shortcut', feature: true, js: true do ...@@ -6,7 +6,7 @@ describe 'Issue Boards shortcut', feature: true, js: true do
before do before do
create(:board, project: project) create(:board, project: project)
login_as :admin gitlab_sign_in :admin
visit namespace_project_path(project.namespace, project) visit namespace_project_path(project.namespace, project)
end end
......
...@@ -12,7 +12,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -12,7 +12,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
before do before do
project.team << [user, :master] project.team << [user, :master]
login_as(user) gitlab_sign_in(user)
end end
it 'shows empty state when no results found' do it 'shows empty state when no results found' do
......
...@@ -11,7 +11,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do ...@@ -11,7 +11,7 @@ describe 'Multiple Issue Boards', feature: true, js: true do
before do before do
project.team << [user, :master] project.team << [user, :master]
login_as(user) gitlab_sign_in(user)
visit namespace_project_boards_path(project.namespace, project) visit namespace_project_boards_path(project.namespace, project)
wait_for_requests wait_for_requests
......
...@@ -10,7 +10,7 @@ describe 'Issue Boards new issue', feature: true, js: true do ...@@ -10,7 +10,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
before do before do
project.team << [user, :master] project.team << [user, :master]
login_as(user) gitlab_sign_in(user)
visit namespace_project_board_path(project.namespace, project, board) visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests wait_for_requests
......
...@@ -21,7 +21,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -21,7 +21,7 @@ describe 'Issue Boards', feature: true, js: true do
project.team << [user, :master] project.team << [user, :master]
project.team.add_developer(user2) project.team.add_developer(user2)
login_as(user) gitlab_sign_in(user)
visit namespace_project_board_path(project.namespace, project, board) visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests wait_for_requests
......
...@@ -13,7 +13,7 @@ describe 'Sub-group project issue boards', :feature, :js do ...@@ -13,7 +13,7 @@ describe 'Sub-group project issue boards', :feature, :js do
before do before do
project.add_master(user) project.add_master(user)
login_as(user) gitlab_sign_in(user)
visit namespace_project_board_path(project.namespace, project, board) visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests wait_for_requests
......
...@@ -68,7 +68,7 @@ feature 'Contributions Calendar', :feature, :js do ...@@ -68,7 +68,7 @@ feature 'Contributions Calendar', :feature, :js do
end end
before do before do
login_as user gitlab_sign_in user
end end
describe 'calendar day selection' do describe 'calendar day selection' do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'CI Lint', js: true do describe 'CI Lint', js: true do
before do before do
login_as :user gitlab_sign_in :user
end end
describe 'YAML parsing' do describe 'YAML parsing' do
......
...@@ -9,7 +9,7 @@ feature 'CI shared runner settings', feature: true do ...@@ -9,7 +9,7 @@ feature 'CI shared runner settings', feature: true do
before do before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
login_as(admin) gitlab_sign_in(admin)
end end
context 'without global shared runners quota' do context 'without global shared runners quota' do
......
...@@ -6,7 +6,7 @@ feature 'CI shared runner limits', feature: true do ...@@ -6,7 +6,7 @@ feature 'CI shared runner limits', feature: true do
let(:group) { create(:group) } let(:group) { create(:group) }
before do before do
login_as(user) gitlab_sign_in(user)
end end
context 'when project member' do context 'when project member' do
......
...@@ -7,7 +7,7 @@ describe 'Commits' do ...@@ -7,7 +7,7 @@ describe 'Commits' do
describe 'CI' do describe 'CI' do
before do before do
login_as :user gitlab_sign_in :user
stub_ci_pipeline_to_return_yaml_file stub_ci_pipeline_to_return_yaml_file
end end
...@@ -191,7 +191,7 @@ describe 'Commits' do ...@@ -191,7 +191,7 @@ describe 'Commits' do
before do before do
project.team << [user, :master] project.team << [user, :master]
login_with(user) gitlab_sign_in(user)
visit namespace_project_commits_path(project.namespace, project, branch_name) visit namespace_project_commits_path(project.namespace, project, branch_name)
end end
......
...@@ -9,7 +9,7 @@ describe "Container Registry" do ...@@ -9,7 +9,7 @@ describe "Container Registry" do
end end
before do before do
login_as(user) gitlab_sign_in(user)
project.add_developer(user) project.add_developer(user)
stub_container_registry_config(enabled: true) stub_container_registry_config(enabled: true)
stub_container_registry_tags(repository: :any, tags: []) stub_container_registry_tags(repository: :any, tags: [])
......
...@@ -6,7 +6,7 @@ describe 'Copy as GFM', feature: true, js: true do ...@@ -6,7 +6,7 @@ describe 'Copy as GFM', feature: true, js: true do
include ActionView::Helpers::JavaScriptHelper include ActionView::Helpers::JavaScriptHelper
before do before do
login_as :admin gitlab_sign_in :admin
end end
describe 'Copying rendered GFM' do describe 'Copying rendered GFM' do
......
...@@ -14,7 +14,7 @@ feature 'Cycle Analytics', feature: true, js: true do ...@@ -14,7 +14,7 @@ feature 'Cycle Analytics', feature: true, js: true do
before do before do
project.add_master(user) project.add_master(user)
login_as(user) gitlab_sign_in(user)
visit namespace_project_cycle_analytics_path(project.namespace, project) visit namespace_project_cycle_analytics_path(project.namespace, project)
wait_for_requests wait_for_requests
...@@ -38,7 +38,7 @@ feature 'Cycle Analytics', feature: true, js: true do ...@@ -38,7 +38,7 @@ feature 'Cycle Analytics', feature: true, js: true do
create_cycle create_cycle
deploy_master deploy_master
login_as(user) gitlab_sign_in(user)
visit namespace_project_cycle_analytics_path(project.namespace, project) visit namespace_project_cycle_analytics_path(project.namespace, project)
end end
...@@ -70,7 +70,7 @@ feature 'Cycle Analytics', feature: true, js: true do ...@@ -70,7 +70,7 @@ feature 'Cycle Analytics', feature: true, js: true do
user.update_attribute(:preferred_language, 'es') user.update_attribute(:preferred_language, 'es')
project.team << [user, :master] project.team << [user, :master]
login_as(user) gitlab_sign_in(user)
visit namespace_project_cycle_analytics_path(project.namespace, project) visit namespace_project_cycle_analytics_path(project.namespace, project)
wait_for_requests wait_for_requests
end end
...@@ -93,7 +93,7 @@ feature 'Cycle Analytics', feature: true, js: true do ...@@ -93,7 +93,7 @@ feature 'Cycle Analytics', feature: true, js: true do
create_cycle create_cycle
deploy_master deploy_master
login_as(guest) gitlab_sign_in(guest)
visit namespace_project_cycle_analytics_path(project.namespace, project) visit namespace_project_cycle_analytics_path(project.namespace, project)
wait_for_requests wait_for_requests
end end
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Active Tab', js: true, feature: true do RSpec.describe 'Dashboard Active Tab', js: true, feature: true do
before do before do
login_as :user gitlab_sign_in :user
end end
shared_examples 'page has active tab' do |title| shared_examples 'page has active tab' do |title|
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Activity', feature: true do RSpec.describe 'Dashboard Activity', feature: true do
before do before do
login_as(create :user) gitlab_sign_in(create :user)
visit activity_dashboard_path visit activity_dashboard_path
end end
......
...@@ -9,7 +9,7 @@ RSpec.describe 'Dashboard Archived Project', feature: true do ...@@ -9,7 +9,7 @@ RSpec.describe 'Dashboard Archived Project', feature: true do
project.team << [user, :master] project.team << [user, :master]
archived_project.team << [user, :master] archived_project.team << [user, :master]
login_as(user) gitlab_sign_in(user)
visit dashboard_projects_path visit dashboard_projects_path
end end
......
...@@ -13,7 +13,7 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do ...@@ -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, Event.create( project: project, author_id: user.id, action: Event::JOINED,
updated_at: created_date, created_at: created_date) updated_at: created_date, created_at: created_date)
login_as user gitlab_sign_in user
visit user_path(user) visit user_path(user)
wait_for_requests() wait_for_requests()
...@@ -30,7 +30,7 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do ...@@ -30,7 +30,7 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do
project.team << [user, :master] project.team << [user, :master]
create(:snippet, author: user, updated_at: created_date, created_at: created_date) create(:snippet, author: user, updated_at: created_date, created_at: created_date)
login_as user gitlab_sign_in user
visit user_snippets_path(user) visit user_snippets_path(user)
wait_for_requests() wait_for_requests()
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Group', feature: true do RSpec.describe 'Dashboard Group', feature: true do
before do before do
login_as(:user) gitlab_sign_in(:user)
end end
it 'creates new group', js: true do it 'creates new group', js: true do
......
...@@ -10,7 +10,7 @@ describe 'Dashboard Groups page', js: true, feature: true do ...@@ -10,7 +10,7 @@ describe 'Dashboard Groups page', js: true, feature: true do
group.add_owner(user) group.add_owner(user)
nested_group.add_owner(user) nested_group.add_owner(user)
login_as(user) gitlab_sign_in(user)
visit dashboard_groups_path visit dashboard_groups_path
expect(page).to have_content(group.full_name) expect(page).to have_content(group.full_name)
...@@ -23,7 +23,7 @@ describe 'Dashboard Groups page', js: true, feature: true do ...@@ -23,7 +23,7 @@ describe 'Dashboard Groups page', js: true, feature: true do
group.add_owner(user) group.add_owner(user)
nested_group.add_owner(user) nested_group.add_owner(user)
login_as(user) gitlab_sign_in(user)
visit dashboard_groups_path visit dashboard_groups_path
end end
...@@ -58,7 +58,7 @@ describe 'Dashboard Groups page', js: true, feature: true do ...@@ -58,7 +58,7 @@ describe 'Dashboard Groups page', js: true, feature: true do
group.add_owner(user) group.add_owner(user)
subgroup.add_owner(user) subgroup.add_owner(user)
login_as(user) gitlab_sign_in(user)
visit dashboard_groups_path visit dashboard_groups_path
end end
...@@ -98,7 +98,7 @@ describe 'Dashboard Groups page', js: true, feature: true do ...@@ -98,7 +98,7 @@ describe 'Dashboard Groups page', js: true, feature: true do
allow(Kaminari.config).to receive(:default_per_page).and_return(1) allow(Kaminari.config).to receive(:default_per_page).and_return(1)
login_as(user) gitlab_sign_in(user)
visit dashboard_groups_path visit dashboard_groups_path
end end
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Help', feature: true do RSpec.describe 'Dashboard Help', feature: true do
before do before do
login_as(:user) gitlab_sign_in(:user)
end end
it 'renders correctly markdown' do it 'renders correctly markdown' do
......
...@@ -9,7 +9,7 @@ describe 'Navigation bar counter', feature: true, caching: true do ...@@ -9,7 +9,7 @@ describe 'Navigation bar counter', feature: true, caching: true do
before do before do
issue.assignees = [user] issue.assignees = [user]
merge_request.update(assignee: user) merge_request.update(assignee: user)
login_as(user) gitlab_sign_in(user)
end end
it 'reflects dashboard issues count' do it 'reflects dashboard issues count' do
......
...@@ -12,7 +12,7 @@ RSpec.describe 'Dashboard Issues', feature: true do ...@@ -12,7 +12,7 @@ RSpec.describe 'Dashboard Issues', feature: true do
before do before do
[project, project_with_issues_disabled].each { |project| project.team << [current_user, :master] } [project, project_with_issues_disabled].each { |project| project.team << [current_user, :master] }
login_as(current_user) gitlab_sign_in(current_user)
visit issues_dashboard_path(assignee_id: current_user.id) visit issues_dashboard_path(assignee_id: current_user.id)
end end
......
...@@ -11,7 +11,7 @@ describe 'Dashboard > label filter', feature: true, js: true do ...@@ -11,7 +11,7 @@ describe 'Dashboard > label filter', feature: true, js: true do
project.labels << label project.labels << label
project2.labels << label2 project2.labels << label2
login_as(user) gitlab_sign_in(user)
visit issues_dashboard_path visit issues_dashboard_path
end end
......
...@@ -8,7 +8,7 @@ describe 'Dashboard Merge Requests' do ...@@ -8,7 +8,7 @@ describe 'Dashboard Merge Requests' do
before do before do
[project, project_with_merge_requests_disabled].each { |project| project.team << [current_user, :master] } [project, project_with_merge_requests_disabled].each { |project| project.team << [current_user, :master] }
login_as(current_user) gitlab_sign_in(current_user)
end end
describe 'new merge request dropdown' do describe 'new merge request dropdown' do
......
...@@ -9,7 +9,7 @@ describe 'Dashboard > milestone filter', :feature, :js do ...@@ -9,7 +9,7 @@ describe 'Dashboard > milestone filter', :feature, :js do
let!(:issue2) { create :issue, author: user, project: project, milestone: milestone2 } let!(:issue2) { create :issue, author: user, project: project, milestone: milestone2 }
before do before do
login_as(user) gitlab_sign_in(user)
visit issues_dashboard_path(author_id: user.id) visit issues_dashboard_path(author_id: user.id)
end end
......
...@@ -15,7 +15,7 @@ describe 'Dashboard milestone tabs', :js, :feature do ...@@ -15,7 +15,7 @@ describe 'Dashboard milestone tabs', :js, :feature do
before do before do
project.add_master(user) project.add_master(user)
login_as(user) gitlab_sign_in(user)
visit dashboard_milestone_path(milestone.safe_title, title: milestone.title) visit dashboard_milestone_path(milestone.safe_title, title: milestone.title)
end end
......
...@@ -7,7 +7,7 @@ RSpec.describe 'Dashboard Projects', feature: true do ...@@ -7,7 +7,7 @@ RSpec.describe 'Dashboard Projects', feature: true do
before do before do
project.team << [user, :developer] project.team << [user, :developer]
login_as(user) gitlab_sign_in(user)
end end
it 'shows the project the user in a member of in the list' do it 'shows the project the user in a member of in the list' do
......
...@@ -3,7 +3,7 @@ require 'spec_helper' ...@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'Dashboard shortcuts', :feature, :js do feature 'Dashboard shortcuts', :feature, :js do
context 'logged in' do context 'logged in' do
before do before do
login_as :user gitlab_sign_in :user
visit root_dashboard_path visit root_dashboard_path
end end
......
...@@ -6,7 +6,7 @@ describe 'Dashboard snippets', feature: true do ...@@ -6,7 +6,7 @@ describe 'Dashboard snippets', feature: true do
let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) } let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) }
before do before do
allow(Snippet).to receive(:default_per_page).and_return(1) allow(Snippet).to receive(:default_per_page).and_return(1)
login_as(project.owner) gitlab_sign_in(project.owner)
visit dashboard_snippets_path visit dashboard_snippets_path
end end
...@@ -25,7 +25,7 @@ describe 'Dashboard snippets', feature: true do ...@@ -25,7 +25,7 @@ describe 'Dashboard snippets', feature: true do
end end
before do before do
login_as(user) gitlab_sign_in(user)
visit dashboard_snippets_path visit dashboard_snippets_path
end end
......
...@@ -9,7 +9,7 @@ describe 'Dashboard > User filters projects', :feature do ...@@ -9,7 +9,7 @@ describe 'Dashboard > User filters projects', :feature do
before do before do
project.team << [user, :master] project.team << [user, :master]
login_as(user) gitlab_sign_in(user)
end end
describe 'filtering personal projects' do describe 'filtering personal projects' do
......
...@@ -8,7 +8,7 @@ describe "Dashboard Issues filtering", feature: true, js: true do ...@@ -8,7 +8,7 @@ describe "Dashboard Issues filtering", feature: true, js: true do
context 'filtering by milestone' do context 'filtering by milestone' do
before do before do
project.team << [user, :master] project.team << [user, :master]
login_as(user) gitlab_sign_in(user)
create(:issue, project: project, author: user, assignees: [user]) create(:issue, project: project, author: user, assignees: [user])
create(:issue, project: project, author: user, assignees: [user], milestone: milestone) create(:issue, project: project, author: user, assignees: [user], milestone: milestone)
......
...@@ -17,7 +17,7 @@ feature 'Dashboard > Milestones', feature: true do ...@@ -17,7 +17,7 @@ feature 'Dashboard > Milestones', feature: true do
let!(:milestone) { create(:milestone, project: project) } let!(:milestone) { create(:milestone, project: project) }
before do before do
project.team << [user, :master] project.team << [user, :master]
login_with(user) gitlab_sign_in(user)
visit dashboard_milestones_path visit dashboard_milestones_path
end end
......
...@@ -9,7 +9,7 @@ describe 'Discussion Comments Merge Request', :feature, :js do ...@@ -9,7 +9,7 @@ describe 'Discussion Comments Merge Request', :feature, :js do
before do before do
project.add_master(user) project.add_master(user)
login_as(user) gitlab_sign_in(user)
visit namespace_project_commit_path(project.namespace, project, sample_commit.id) visit namespace_project_commit_path(project.namespace, project, sample_commit.id)
end end
......
...@@ -7,7 +7,7 @@ describe 'Discussion Comments Issue', :feature, :js do ...@@ -7,7 +7,7 @@ describe 'Discussion Comments Issue', :feature, :js do
before do before do
project.add_master(user) project.add_master(user)
login_as(user) gitlab_sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue) visit namespace_project_issue_path(project.namespace, project, issue)
end end
......
...@@ -7,7 +7,7 @@ describe 'Discussion Comments Merge Request', :feature, :js do ...@@ -7,7 +7,7 @@ describe 'Discussion Comments Merge Request', :feature, :js do
before do before do
project.add_master(user) project.add_master(user)
login_as(user) gitlab_sign_in(user)
visit namespace_project_merge_request_path(project.namespace, project, merge_request) visit namespace_project_merge_request_path(project.namespace, project, merge_request)
end end
......
...@@ -7,7 +7,7 @@ describe 'Discussion Comments Issue', :feature, :js do ...@@ -7,7 +7,7 @@ describe 'Discussion Comments Issue', :feature, :js do
before do before do
project.add_master(user) project.add_master(user)
login_as(user) gitlab_sign_in(user)
visit namespace_project_snippet_path(project.namespace, project, snippet) visit namespace_project_snippet_path(project.namespace, project, snippet)
end end
......
...@@ -9,7 +9,7 @@ feature 'Global elastic search', feature: true do ...@@ -9,7 +9,7 @@ feature 'Global elastic search', feature: true do
Gitlab::Elastic::Helper.create_empty_index Gitlab::Elastic::Helper.create_empty_index
project.team << [user, :master] project.team << [user, :master]
login_with(user) gitlab_sign_in(user)
end end
after do after do
......
...@@ -21,7 +21,7 @@ feature 'Group elastic search', js: true, feature: true do ...@@ -21,7 +21,7 @@ feature 'Group elastic search', js: true, feature: true do
project.team << [user, :master] project.team << [user, :master]
group.add_owner(user) group.add_owner(user)
login_with(user) gitlab_sign_in(user)
end end
after do after do
......
...@@ -10,7 +10,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do ...@@ -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(:size_limit).and_return(100.kilobytes)
allow(Gitlab::Git::Diff).to receive(:collapse_limit).and_return(10.kilobytes) allow(Gitlab::Git::Diff).to receive(:collapse_limit).and_return(10.kilobytes)
login_as :admin gitlab_sign_in :admin
# Ensure that undiffable.md is in .gitattributes # Ensure that undiffable.md is in .gitattributes
project.repository.copy_gitattributes(branch) project.repository.copy_gitattributes(branch)
......
...@@ -10,7 +10,7 @@ describe 'Explore Groups page', :js, :feature do ...@@ -10,7 +10,7 @@ describe 'Explore Groups page', :js, :feature do
before do before do
group.add_owner(user) group.add_owner(user)
login_as(user) gitlab_sign_in(user)
visit explore_groups_path visit explore_groups_path
end end
......
...@@ -16,7 +16,7 @@ feature 'Top Plus Menu', feature: true, js: true do ...@@ -16,7 +16,7 @@ feature 'Top Plus Menu', feature: true, js: true do
context 'used by full user' do context 'used by full user' do
before do before do
login_as(user) gitlab_sign_in(user)
end end
scenario 'click on New project shows new project page' do scenario 'click on New project shows new project page' do
...@@ -103,7 +103,7 @@ feature 'Top Plus Menu', feature: true, js: true do ...@@ -103,7 +103,7 @@ feature 'Top Plus Menu', feature: true, js: true do
context 'used by guest user' do context 'used by guest user' do
before do before do
login_as(guest_user) gitlab_sign_in(guest_user)
end end
scenario 'click on New issue shows new issue page' do scenario 'click on New issue shows new issue page' do
......
...@@ -10,7 +10,7 @@ describe "GitLab Flavored Markdown", feature: true do ...@@ -10,7 +10,7 @@ describe "GitLab Flavored Markdown", feature: true do
end end
before do before do
login_as(:user) gitlab_sign_in(:user)
project.add_developer(@user) project.add_developer(@user)
end end
......
...@@ -6,7 +6,7 @@ feature 'Global search', feature: true do ...@@ -6,7 +6,7 @@ feature 'Global search', feature: true do
before do before do
project.team << [user, :master] project.team << [user, :master]
login_with(user) gitlab_sign_in(user)
end end
describe 'I search through the issues and I see pagination' do describe 'I search through the issues and I see pagination' do
......
...@@ -7,7 +7,7 @@ feature 'Group activity page', feature: true do ...@@ -7,7 +7,7 @@ feature 'Group activity page', feature: true do
context 'when signed in' do context 'when signed in' do
before do before do
user = create(:group_member, :developer, user: create(:user), group: group ).user user = create(:group_member, :developer, user: create(:user), group: group ).user
login_as(user) gitlab_sign_in(user)
visit path visit path
end end
......
...@@ -7,7 +7,7 @@ feature 'Groups > Contribution Analytics', js: true, feature: true do ...@@ -7,7 +7,7 @@ feature 'Groups > Contribution Analytics', js: true, feature: true do
before do before do
group.add_owner(user) group.add_owner(user)
login_with(user) gitlab_sign_in(user)
end end
describe 'visit Contribution Analytics page for group' do describe 'visit Contribution Analytics page for group' do
......
...@@ -8,7 +8,7 @@ feature 'Groups > Audit Events', js: true, feature: true do ...@@ -8,7 +8,7 @@ feature 'Groups > Audit Events', js: true, feature: true do
before do before do
group.add_owner(user) group.add_owner(user)
group.add_developer(pete) group.add_developer(pete)
login_with(user) gitlab_sign_in(user)
end end
describe 'changing a user access level' do describe 'changing a user access level' do
......
...@@ -5,7 +5,7 @@ feature 'Groups Merge Requests Empty States' do ...@@ -5,7 +5,7 @@ feature 'Groups Merge Requests Empty States' do
let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user } let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user }
before do before do
login_as(user) gitlab_sign_in(user)
end end
context 'group has a project' do context 'group has a project' do
......
...@@ -9,7 +9,7 @@ feature 'Group name toggle', feature: true, js: true do ...@@ -9,7 +9,7 @@ feature 'Group name toggle', feature: true, js: true do
SMALL_SCREEN = 300 SMALL_SCREEN = 300
before do before do
login_as :user gitlab_sign_in :user
end end
it 'is not present if enough horizontal space' do it 'is not present if enough horizontal space' do
......
...@@ -6,7 +6,7 @@ feature 'Edit group settings', feature: true do ...@@ -6,7 +6,7 @@ feature 'Edit group settings', feature: true do
background do background do
group.add_owner(user) group.add_owner(user)
login_as(user) gitlab_sign_in(user)
end end
describe 'when the group path is changed' do describe 'when the group path is changed' do
......
...@@ -7,7 +7,7 @@ feature 'Edit group label', feature: true do ...@@ -7,7 +7,7 @@ feature 'Edit group label', feature: true do
background do background do
group.add_owner(user) group.add_owner(user)
login_as(user) gitlab_sign_in(user)
visit edit_group_label_path(group, label) visit edit_group_label_path(group, label)
end end
......
...@@ -6,7 +6,7 @@ feature 'Groups > Members > Last owner cannot leave group', feature: true do ...@@ -6,7 +6,7 @@ feature 'Groups > Members > Last owner cannot leave group', feature: true do
background do background do
group.add_owner(owner) group.add_owner(owner)
login_as(owner) gitlab_sign_in(owner)
visit group_path(group) visit group_path(group)
end end
......
...@@ -9,7 +9,7 @@ feature 'Groups members list', feature: true do ...@@ -9,7 +9,7 @@ feature 'Groups members list', feature: true do
let(:nested_group) { create(:group, parent: group) } let(:nested_group) { create(:group, parent: group) }
background do background do
login_as(user1) gitlab_sign_in(user1)
end end
scenario 'show members from current group and parent', :nested_groups do scenario 'show members from current group and parent', :nested_groups do
......
...@@ -6,7 +6,7 @@ feature 'Groups > Members > Member cannot request access to his project', featur ...@@ -6,7 +6,7 @@ feature 'Groups > Members > Member cannot request access to his project', featur
background do background do
group.add_developer(member) group.add_developer(member)
login_as(member) gitlab_sign_in(member)
visit group_path(group) visit group_path(group)
end end
......
...@@ -8,7 +8,7 @@ feature 'Groups > Members > Member leaves group', feature: true do ...@@ -8,7 +8,7 @@ feature 'Groups > Members > Member leaves group', feature: true do
background do background do
group.add_owner(owner) group.add_owner(owner)
group.add_developer(user) group.add_developer(user)
login_as(user) gitlab_sign_in(user)
visit group_path(group) visit group_path(group)
end end
......
...@@ -17,7 +17,7 @@ feature 'Groups > Members > Master/Owner can override LDAP access levels', featu ...@@ -17,7 +17,7 @@ feature 'Groups > Members > Master/Owner can override LDAP access levels', featu
# We need to actually activate the LDAP config otherwise `Group#ldap_synced?` will always be false! # We need to actually activate the LDAP config otherwise `Group#ldap_synced?` will always be false!
allow(Gitlab.config.ldap).to receive_messages(enabled: true) allow(Gitlab.config.ldap).to receive_messages(enabled: true)
login_as(owner) gitlab_sign_in(owner)
end end
scenario 'override not available on project members page', js: true do scenario 'override not available on project members page', js: true do
......
...@@ -8,7 +8,7 @@ feature 'Groups > Members > Owner manages access requests', feature: true do ...@@ -8,7 +8,7 @@ feature 'Groups > Members > Owner manages access requests', feature: true do
background do background do
group.request_access(user) group.request_access(user)
group.add_owner(owner) group.add_owner(owner)
login_as(owner) gitlab_sign_in(owner)
end end
scenario 'owner can see access requests' do scenario 'owner can see access requests' do
......
...@@ -9,7 +9,7 @@ feature 'Groups > Members > Sorting', feature: true do ...@@ -9,7 +9,7 @@ feature 'Groups > Members > Sorting', feature: true do
create(:group_member, :owner, user: owner, group: group, created_at: 5.days.ago) 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) create(:group_member, :developer, user: developer, group: group, created_at: 3.days.ago)
login_as(owner) gitlab_sign_in(owner)
end end
scenario 'sorts alphabetically by default' do scenario 'sorts alphabetically by default' do
......
...@@ -8,7 +8,7 @@ feature 'Groups > Members > User requests access', feature: true do ...@@ -8,7 +8,7 @@ feature 'Groups > Members > User requests access', feature: true do
background do background do
group.add_owner(owner) group.add_owner(owner)
login_as(user) gitlab_sign_in(user)
visit group_path(group) visit group_path(group)
end end
......
...@@ -8,7 +8,7 @@ feature 'Group milestones', :feature, :js do ...@@ -8,7 +8,7 @@ feature 'Group milestones', :feature, :js do
before do before do
Timecop.freeze Timecop.freeze
login_as(user) gitlab_sign_in(user)
end end
after do after do
......
...@@ -7,7 +7,7 @@ feature 'Groups > Pipeline Quota', feature: true do ...@@ -7,7 +7,7 @@ feature 'Groups > Pipeline Quota', feature: true do
before do before do
group.add_owner(user) group.add_owner(user)
login_with(user) gitlab_sign_in(user)
end end
context 'with no quota' do context 'with no quota' do
......
...@@ -7,7 +7,7 @@ feature 'Group show page', feature: true do ...@@ -7,7 +7,7 @@ feature 'Group show page', feature: true do
context 'when signed in' do context 'when signed in' do
before do before do
user = create(:group_member, :developer, user: create(:user), group: group ).user user = create(:group_member, :developer, user: create(:user), group: group ).user
login_as(user) gitlab_sign_in(user)
visit path visit path
end end
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Group', feature: true do feature 'Group', feature: true do
before do before do
login_as(:admin) gitlab_sign_in(:admin)
end end
matcher :have_namespace_error_message do matcher :have_namespace_error_message do
...@@ -108,8 +108,8 @@ feature 'Group', feature: true do ...@@ -108,8 +108,8 @@ feature 'Group', feature: true do
before do before do
group.add_owner(user) group.add_owner(user)
logout gitlab_sign_out
login_as(user) gitlab_sign_in(user)
visit subgroups_group_path(group) visit subgroups_group_path(group)
click_link 'New Subgroup' click_link 'New Subgroup'
...@@ -128,8 +128,8 @@ feature 'Group', feature: true do ...@@ -128,8 +128,8 @@ feature 'Group', feature: true do
it 'checks permissions to avoid exposing groups by parent_id' do it 'checks permissions to avoid exposing groups by parent_id' do
group = create(:group, :private, path: 'secret-group') group = create(:group, :private, path: 'secret-group')
logout gitlab_sign_out
login_as(:user) gitlab_sign_in(:user)
visit new_group_path(parent_id: group.id) visit new_group_path(parent_id: group.id)
expect(page).not_to have_content('secret-group') expect(page).not_to have_content('secret-group')
......
...@@ -40,7 +40,7 @@ describe 'Help Pages', feature: true do ...@@ -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(ApplicationSetting).to receive(:version_check_enabled) { true }
allow_any_instance_of(VersionCheck).to receive(:url) { '/version-check-url' } allow_any_instance_of(VersionCheck).to receive(:url) { '/version-check-url' }
login_as :user gitlab_sign_in :user
visit help_path visit help_path
end end
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment