Commit 64701b51 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'rs-sign_in' into 'master'

Change gitlab_sign_in to sign_in

See merge request !12369
parents f225cc9b 60814985
...@@ -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
gitlab_sign_in :user sign_in(create(: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
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in :admin sign_in(create(:admin))
visit admin_appearances_path visit admin_appearances_path
attach_file(:appearance_header_logo, logo_fixture) attach_file(:appearance_header_logo, logo_fixture)
......
...@@ -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
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in(:admin) sign_in(create(: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')
gitlab_sign_in(admin) 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
gitlab_sign_in(:admin) sign_in(create(: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
gitlab_sign_in(:admin) sign_in(create(:admin))
user = create(:user) user = create(:user)
edit_user(user) edit_user(user)
......
...@@ -6,9 +6,10 @@ feature 'Admin Groups', feature: true do ...@@ -6,9 +6,10 @@ 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) { gitlab_sign_in :admin } let!(:current_user) { create(:admin) }
before do before do
sign_in(current_user)
stub_application_setting(default_group_visibility: internal) stub_application_setting(default_group_visibility: internal)
end end
......
...@@ -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')
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in :admin sign_in(create(: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)
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in :admin sign_in(create(:admin))
end end
describe 'list' do describe 'list' 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
gitlab_sign_in :admin sign_in(create(:admin))
end end
it do it do
......
...@@ -5,8 +5,10 @@ describe "Admin::Projects", feature: true do ...@@ -5,8 +5,10 @@ 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) { create(:admin) }
gitlab_sign_in :admin
before do
sign_in(current_user)
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)
gitlab_sign_in(:admin) sign_in(create(: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')
gitlab_sign_in :admin sign_in(create(: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')
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in(admin) sign_in(admin)
end end
describe "token creation" do describe "token creation" do
......
...@@ -5,7 +5,11 @@ describe "Admin::Users", feature: true do ...@@ -5,7 +5,11 @@ 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) { gitlab_sign_in :admin } let!(:current_user) { create(:admin) }
before do
sign_in(current_user)
end
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')
gitlab_sign_in :admin sign_in(create(: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
gitlab_sign_in user sign_in user
visit project_issues_path(project, :atom) visit project_issues_path(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]
gitlab_sign_in user 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]
gitlab_sign_in(user) sign_in(user)
visit project_board_path(project, board) visit project_board_path(project, board)
wait_for_requests wait_for_requests
......
...@@ -12,7 +12,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -12,7 +12,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]
gitlab_sign_in(user) sign_in(user)
end end
context 'no lists' do context 'no lists' do
...@@ -519,7 +519,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -519,7 +519,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'signed out user' do context 'signed out user' do
before do before do
gitlab_sign_out sign_out(:user)
visit project_board_path(project, board) visit project_board_path(project, board)
wait_for_requests wait_for_requests
end end
...@@ -542,8 +542,8 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -542,8 +542,8 @@ describe 'Issue Boards', feature: true, js: true do
before do before do
project.team << [user_guest, :guest] project.team << [user_guest, :guest]
gitlab_sign_out sign_out(:user)
gitlab_sign_in(user_guest) sign_in(user_guest)
visit project_board_path(project, board) visit project_board_path(project, board)
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]
gitlab_sign_in(user) 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)
gitlab_sign_in :admin sign_in(create(:admin))
visit project_path(project) visit project_path(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]
gitlab_sign_in(user) sign_in(user)
end end
it 'shows empty state when no results found' do it 'shows empty state when no results found' do
......
...@@ -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]
gitlab_sign_in(user) sign_in(user)
visit project_board_path(project, board) visit project_board_path(project, board)
wait_for_requests wait_for_requests
......
...@@ -20,7 +20,7 @@ describe 'Issue Boards', feature: true, js: true do ...@@ -20,7 +20,7 @@ describe 'Issue Boards', feature: true, js: true do
project.team << [user, :master] project.team << [user, :master]
gitlab_sign_in(user) sign_in(user)
visit project_board_path(project, board) visit project_board_path(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)
gitlab_sign_in(user) sign_in(user)
visit project_board_path(project, board) visit project_board_path(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
gitlab_sign_in user 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
gitlab_sign_in :user sign_in(create(:user))
end end
describe 'YAML parsing' do describe 'YAML parsing' do
......
...@@ -9,7 +9,7 @@ describe "Container Registry" do ...@@ -9,7 +9,7 @@ describe "Container Registry" do
end end
before do before do
gitlab_sign_in(user) 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
gitlab_sign_in :admin sign_in(create(: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)
gitlab_sign_in(user) sign_in(user)
visit project_cycle_analytics_path(project) visit project_cycle_analytics_path(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
gitlab_sign_in(user) sign_in(user)
visit project_cycle_analytics_path(project) visit project_cycle_analytics_path(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]
gitlab_sign_in(user) sign_in(user)
visit project_cycle_analytics_path(project) visit project_cycle_analytics_path(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
gitlab_sign_in(guest) sign_in(guest)
visit project_cycle_analytics_path(project) visit project_cycle_analytics_path(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
gitlab_sign_in :user sign_in(create(:user))
end end
shared_examples 'page has active tab' do |title| shared_examples 'page has active tab' do |title|
......
require 'spec_helper' require 'spec_helper'
RSpec.describe 'Dashboard Activity', feature: true do RSpec.describe 'Dashboard Activity', feature: true do
let(:user) { create(:user) }
before do before do
gitlab_sign_in(create :user) sign_in(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]
gitlab_sign_in(user) 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)
gitlab_sign_in user 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)
gitlab_sign_in user 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
gitlab_sign_in(:user) sign_in(create(: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)
gitlab_sign_in(user) 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)
gitlab_sign_in(user) 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)
gitlab_sign_in(user) 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)
gitlab_sign_in(user) 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
gitlab_sign_in(:user) sign_in(create(: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)
gitlab_sign_in(user) sign_in(user)
end end
it 'reflects dashboard issues count' do it 'reflects dashboard issues count' do
......
...@@ -2,6 +2,7 @@ require 'spec_helper' ...@@ -2,6 +2,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Issues', feature: true do RSpec.describe 'Dashboard Issues', feature: true do
let(:current_user) { create :user } let(:current_user) { create :user }
let(:user) { current_user } # Shared examples depend on this being available
let!(:public_project) { create(:empty_project, :public) } let!(:public_project) { create(:empty_project, :public) }
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
let(:project_with_issues_disabled) { create(:empty_project, :issues_disabled) } let(:project_with_issues_disabled) { create(:empty_project, :issues_disabled) }
...@@ -12,7 +13,7 @@ RSpec.describe 'Dashboard Issues', feature: true do ...@@ -12,7 +13,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] }
gitlab_sign_in(current_user) 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
gitlab_sign_in(user) sign_in(user)
visit issues_dashboard_path visit issues_dashboard_path
end end
......
...@@ -11,7 +11,7 @@ feature 'Dashboard > milestone filter', :feature, :js do ...@@ -11,7 +11,7 @@ feature '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
gitlab_sign_in(user) 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)
gitlab_sign_in(user) 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,13 @@ feature 'Dashboard Projects' do ...@@ -7,7 +7,13 @@ feature 'Dashboard Projects' do
before do before do
project.team << [user, :developer] 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 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
...@@ -71,6 +77,4 @@ feature 'Dashboard Projects' do ...@@ -71,6 +77,4 @@ feature 'Dashboard Projects' do
expect(page).to have_xpath("//a[@href='#{pipelines_project_commit_path(project, project.commit)}']") expect(page).to have_xpath("//a[@href='#{pipelines_project_commit_path(project, project.commit)}']")
end end
end end
it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
end end
...@@ -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
gitlab_sign_in :user sign_in(create(: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)
gitlab_sign_in(project.owner) 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
gitlab_sign_in(user) sign_in(user)
visit dashboard_snippets_path visit dashboard_snippets_path
end end
......
...@@ -83,7 +83,7 @@ feature 'Dashboard > User sorts todos' do ...@@ -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: issue_2)
create(:todo, user: user, project: project, target: merge_request_1) create(:todo, user: user, project: project, target: merge_request_1)
gitlab_sign_in(user) sign_in(user)
visit dashboard_todos_path visit dashboard_todos_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]
gitlab_sign_in(user) 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]
gitlab_sign_in(user) 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]
gitlab_sign_in(user) 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)
gitlab_sign_in(user) sign_in(user)
visit project_commit_path(project, sample_commit.id) visit project_commit_path(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)
gitlab_sign_in(user) sign_in(user)
visit project_issue_path(project, issue) visit project_issue_path(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)
gitlab_sign_in(user) sign_in(user)
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(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)
gitlab_sign_in(user) sign_in(user)
visit project_snippet_path(project, snippet) visit project_snippet_path(project, snippet)
end end
......
...@@ -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)
gitlab_sign_in :admin sign_in(create(: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)
gitlab_sign_in(user) 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
gitlab_sign_in(user) 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
gitlab_sign_in(guest_user) 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
......
...@@ -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]
gitlab_sign_in(user) 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
......
require 'spec_helper' require 'spec_helper'
feature 'Group activity page', feature: true do feature 'Group activity page', feature: true do
let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:path) { activity_group_path(group) } let(:path) { activity_group_path(group) }
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 sign_in(user)
gitlab_sign_in(user)
visit path visit path
end end
......
...@@ -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
gitlab_sign_in(user) 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
gitlab_sign_in :user sign_in(create(: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)
gitlab_sign_in(user) 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)
gitlab_sign_in(user) sign_in(user)
visit edit_group_label_path(group, label) visit edit_group_label_path(group, label)
end end
......
...@@ -8,7 +8,7 @@ feature 'Groups > Members > Manage access requests', feature: true do ...@@ -8,7 +8,7 @@ feature 'Groups > Members > Manage 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)
gitlab_sign_in(owner) sign_in(owner)
end end
scenario 'owner can see access requests' do scenario 'owner can see access requests' do
......
...@@ -8,7 +8,7 @@ feature 'Groups > Members > Manage members', feature: true do ...@@ -8,7 +8,7 @@ feature 'Groups > Members > Manage members', feature: true do
let(:group) { create(:group) } let(:group) { create(:group) }
background do background do
gitlab_sign_in(user1) sign_in(user1)
end end
scenario 'update user to owner level', :js do scenario 'update user to owner level', :js do
......
...@@ -8,7 +8,7 @@ feature 'Groups > Members > Request access', feature: true do ...@@ -8,7 +8,7 @@ feature 'Groups > Members > Request access', feature: true do
background do background do
group.add_owner(owner) group.add_owner(owner)
gitlab_sign_in(user) sign_in(user)
visit group_path(group) visit group_path(group)
end end
......
...@@ -9,7 +9,7 @@ feature 'Groups > Members > Sort members', feature: true do ...@@ -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, :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)
gitlab_sign_in(owner) sign_in(owner)
end end
scenario 'sorts alphabetically by default' do scenario 'sorts alphabetically by default' do
......
...@@ -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
gitlab_sign_in(user) sign_in(user)
end end
after do after do
......
...@@ -5,9 +5,12 @@ feature 'Group show page', feature: true do ...@@ -5,9 +5,12 @@ feature 'Group show page', feature: true do
let(:path) { group_path(group) } let(:path) { group_path(group) }
context 'when signed in' do context 'when signed in' do
let(:user) do
create(:group_member, :developer, user: create(:user), group: group ).user
end
before do before do
user = create(:group_member, :developer, user: create(:user), group: group ).user sign_in(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
gitlab_sign_in(:admin) sign_in(create(: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)
gitlab_sign_out sign_out(:user)
gitlab_sign_in(user) 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')
gitlab_sign_out sign_out(:user)
gitlab_sign_in(:user) sign_in(create(: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' }
gitlab_sign_in :user sign_in(create(:user))
visit help_path visit help_path
end end
...@@ -60,7 +60,7 @@ describe 'Help Pages', feature: true do ...@@ -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_text) { "My Custom Text" }
allow_any_instance_of(ApplicationSetting).to receive(:help_page_support_url) { "http://example.com/help" } 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 visit help_path
end end
......
...@@ -8,7 +8,7 @@ describe 'issuable list', feature: true do ...@@ -8,7 +8,7 @@ describe 'issuable list', feature: true do
before do before do
project.add_user(user, :developer) project.add_user(user, :developer)
gitlab_sign_in(user) sign_in(user)
issuable_types.each { |type| create_issuables(type) } issuable_types.each { |type| create_issuables(type) }
end end
......
...@@ -12,7 +12,7 @@ describe 'Awards Emoji', feature: true do ...@@ -12,7 +12,7 @@ describe 'Awards Emoji', feature: true do
context 'authorized user' do context 'authorized user' do
before do before do
project.team << [user, :master] project.team << [user, :master]
gitlab_sign_in(user) sign_in(user)
end end
describe 'visiting an issue with a legacy award emoji that is not valid anymore' do describe 'visiting an issue with a legacy award emoji that is not valid anymore' do
......
...@@ -7,7 +7,7 @@ feature 'Issue awards', js: true, feature: true do ...@@ -7,7 +7,7 @@ feature 'Issue awards', js: true, feature: true do
describe 'logged in' do describe 'logged in' do
before do before do
gitlab_sign_in(user) sign_in(user)
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
wait_for_requests wait_for_requests
end end
......
...@@ -13,7 +13,7 @@ feature 'Issues > Labels bulk assignment', feature: true do ...@@ -13,7 +13,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
before do before do
project.team << [user, :master] project.team << [user, :master]
gitlab_sign_in user sign_in user
end end
context 'sidebar' do context 'sidebar' do
...@@ -346,7 +346,7 @@ feature 'Issues > Labels bulk assignment', feature: true do ...@@ -346,7 +346,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
context 'as a guest' do context 'as a guest' do
before do before do
gitlab_sign_in user sign_in user
visit project_issues_path(project) visit project_issues_path(project)
end end
......
...@@ -8,7 +8,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js: ...@@ -8,7 +8,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js:
context 'for team members' do context 'for team members' do
before do before do
project.team << [user, :developer] project.team << [user, :developer]
gitlab_sign_in(user) sign_in(user)
end end
it 'allows creating a merge request from the issue page' do it 'allows creating a merge request from the issue page' do
......
...@@ -9,7 +9,7 @@ feature 'Resolving all open discussions in a merge request from an issue', featu ...@@ -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 describe 'as a user with access to the project' do
before do before do
project.team << [user, :master] project.team << [user, :master]
gitlab_sign_in user sign_in user
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
end end
...@@ -82,7 +82,7 @@ feature 'Resolving all open discussions in a merge request from an issue', featu ...@@ -82,7 +82,7 @@ feature 'Resolving all open discussions in a merge request from an issue', featu
describe 'as a reporter' do describe 'as a reporter' do
before do before do
project.team << [user, :reporter] project.team << [user, :reporter]
gitlab_sign_in user sign_in user
visit new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid) visit new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid)
end end
......
...@@ -9,7 +9,7 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe ...@@ -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 describe 'As a user with access to the project' do
before do before do
project.team << [user, :master] project.team << [user, :master]
gitlab_sign_in user sign_in user
visit project_merge_request_path(project, merge_request) visit project_merge_request_path(project, merge_request)
end end
...@@ -66,9 +66,8 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe ...@@ -66,9 +66,8 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe
describe 'as a reporter' do describe 'as a reporter' do
before do before do
project.team << [user, :reporter] project.team << [user, :reporter]
gitlab_sign_in user sign_in user
visit new_project_issue_path(project, visit new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid,
merge_request_to_resolve_discussions_of: merge_request.iid,
discussion_to_resolve: discussion.id) discussion_to_resolve: discussion.id)
end end
......
...@@ -23,7 +23,7 @@ describe 'Dropdown assignee', :feature, :js do ...@@ -23,7 +23,7 @@ describe 'Dropdown assignee', :feature, :js do
project.team << [user, :master] project.team << [user, :master]
project.team << [user_john, :master] project.team << [user_john, :master]
project.team << [user_jacob, :master] project.team << [user_jacob, :master]
gitlab_sign_in(user) sign_in(user)
create(:issue, project: project) create(:issue, project: project)
visit project_issues_path(project) visit project_issues_path(project)
......
...@@ -31,7 +31,7 @@ describe 'Dropdown author', js: true, feature: true do ...@@ -31,7 +31,7 @@ describe 'Dropdown author', js: true, feature: true do
project.team << [user, :master] project.team << [user, :master]
project.team << [user_john, :master] project.team << [user_john, :master]
project.team << [user_jacob, :master] project.team << [user_jacob, :master]
gitlab_sign_in(user) sign_in(user)
create(:issue, project: project) create(:issue, project: project)
visit project_issues_path(project) visit project_issues_path(project)
......
...@@ -14,7 +14,7 @@ describe 'Dropdown hint', :js, :feature do ...@@ -14,7 +14,7 @@ describe 'Dropdown hint', :js, :feature do
before do before do
project.team << [user, :master] project.team << [user, :master]
gitlab_sign_in(user) sign_in(user)
create(:issue, project: project) create(:issue, project: project)
visit project_issues_path(project) visit project_issues_path(project)
......
...@@ -34,7 +34,7 @@ describe 'Dropdown label', js: true, feature: true do ...@@ -34,7 +34,7 @@ describe 'Dropdown label', js: true, feature: true do
before do before do
project.add_master(user) project.add_master(user)
gitlab_sign_in(user) sign_in(user)
create(:issue, project: project) create(:issue, project: project)
visit project_issues_path(project) visit project_issues_path(project)
......
...@@ -30,7 +30,7 @@ describe 'Dropdown milestone', :feature, :js do ...@@ -30,7 +30,7 @@ describe 'Dropdown milestone', :feature, :js do
before do before do
project.team << [user, :master] project.team << [user, :master]
gitlab_sign_in(user) sign_in(user)
create(:issue, project: project) create(:issue, project: project)
visit project_issues_path(project) visit project_issues_path(project)
......
...@@ -9,7 +9,7 @@ describe 'Search bar', js: true, feature: true do ...@@ -9,7 +9,7 @@ describe 'Search bar', js: true, feature: true do
before do before do
project.team << [user, :master] project.team << [user, :master]
gitlab_sign_in(user) sign_in(user)
create(:issue, project: project) create(:issue, project: project)
visit project_issues_path(project) visit project_issues_path(project)
......
...@@ -25,7 +25,7 @@ describe 'Visual tokens', js: true, feature: true do ...@@ -25,7 +25,7 @@ describe 'Visual tokens', js: true, feature: true do
before do before do
project.add_user(user, :master) project.add_user(user, :master)
project.add_user(user_rock, :master) project.add_user(user_rock, :master)
gitlab_sign_in(user) sign_in(user)
create(:issue, project: project) create(:issue, project: project)
visit project_issues_path(project) visit project_issues_path(project)
......
...@@ -15,7 +15,7 @@ describe 'New/edit issue', :feature, :js do ...@@ -15,7 +15,7 @@ describe 'New/edit issue', :feature, :js do
before do before do
project.team << [user, :master] project.team << [user, :master]
project.team << [user2, :master] project.team << [user2, :master]
gitlab_sign_in(user) sign_in(user)
end end
context 'new issue' do context 'new issue' do
......
...@@ -8,7 +8,7 @@ feature 'GFM autocomplete', feature: true, js: true do ...@@ -8,7 +8,7 @@ feature 'GFM autocomplete', feature: true, js: true do
before do before do
project.team << [user, :master] project.team << [user, :master]
gitlab_sign_in(user) sign_in(user)
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
wait_for_requests wait_for_requests
......
...@@ -10,7 +10,7 @@ feature 'Issue Sidebar', feature: true do ...@@ -10,7 +10,7 @@ feature 'Issue Sidebar', feature: true do
let!(:label) { create(:label, project: project, title: 'bug') } let!(:label) { create(:label, project: project, title: 'bug') }
before do before do
gitlab_sign_in(user) sign_in(user)
end end
context 'assignee', js: true do context 'assignee', js: true do
......
...@@ -6,7 +6,7 @@ feature 'Issue markdown toolbar', feature: true, js: true do ...@@ -6,7 +6,7 @@ feature 'Issue markdown toolbar', feature: true, js: true do
let(:user) { create(:user) } let(:user) { create(:user) }
before do before do
gitlab_sign_in(user) sign_in(user)
visit project_issue_path(project, issue) visit project_issue_path(project, issue)
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.
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