Commit e939bf7b authored by Robert Speicher's avatar Robert Speicher

Change gitlab_sign_in to sign_in where possible

parent 5a983ac4
......@@ -4,7 +4,7 @@ feature 'Abuse reports', feature: true do
let(:another_user) { create(:user) }
before do
gitlab_sign_in :user
sign_in(create(:user))
end
scenario 'Report abuse' do
......
......@@ -5,7 +5,7 @@ describe "Admin::AbuseReports", feature: true, js: true do
context 'as an admin' do
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
describe 'if a user has been reported for abuse' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'admin active tab' do
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
shared_examples 'page has active tab' do |title|
......
......@@ -4,7 +4,7 @@ feature 'Admin Appearance', feature: true do
let!(:appearance) { create(:appearance) }
scenario 'Create new appearance' do
gitlab_sign_in :admin
sign_in(create(:admin))
visit admin_appearances_path
fill_in 'appearance_title', with: 'MyCompany'
......@@ -20,7 +20,7 @@ feature 'Admin Appearance', feature: true do
end
scenario 'Preview appearance' do
gitlab_sign_in :admin
sign_in(create(:admin))
visit admin_appearances_path
click_link "Preview"
......@@ -34,7 +34,7 @@ feature 'Admin Appearance', feature: true do
end
scenario 'Appearance logo' do
gitlab_sign_in :admin
sign_in(create(:admin))
visit admin_appearances_path
attach_file(:appearance_logo, logo_fixture)
......@@ -46,7 +46,7 @@ feature 'Admin Appearance', feature: true do
end
scenario 'Header logos' do
gitlab_sign_in :admin
sign_in(create(:admin))
visit admin_appearances_path
attach_file(:appearance_header_logo, logo_fixture)
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Admin Broadcast Messages', feature: true do
before do
gitlab_sign_in :admin
sign_in(create(:admin))
create(:broadcast_message, :expired, message: 'Migration to new server')
visit admin_broadcast_messages_path
end
......
......@@ -4,7 +4,7 @@ describe 'Admin browse spam logs' do
let!(:spam_log) { create(:spam_log, description: 'abcde ' * 20) }
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
scenario 'Browse spam logs' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin browses logs' do
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
it 'shows available log files' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin Builds' do
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
describe 'GET /admin/builds' do
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Admin cohorts page', feature: true do
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
scenario 'See users count per month' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin Conversational Development Index' do
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
context 'when usage ping is disabled' do
......
......@@ -5,7 +5,7 @@ RSpec.describe 'admin deploy keys', type: :feature do
let!(:another_deploy_key) { create(:another_deploy_key, public: true) }
before do
gitlab_sign_in(:admin)
sign_in(create(:admin))
end
it 'show all public deploy keys' do
......
......@@ -8,7 +8,7 @@ feature 'Admin disables Git access protocol', feature: true do
background do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
gitlab_sign_in(admin)
sign_in(admin)
end
context 'with HTTP disabled' do
......
......@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Admin disables 2FA for a user', feature: true do
scenario 'successfully', js: true do
gitlab_sign_in(:admin)
sign_in(create(:admin))
user = create(:user, :two_factor)
edit_user(user)
......@@ -17,7 +17,7 @@ feature 'Admin disables 2FA for a user', feature: true do
end
scenario 'for a user without 2FA enabled' do
gitlab_sign_in(:admin)
sign_in(create(:admin))
user = create(:user)
edit_user(user)
......
......@@ -6,9 +6,10 @@ feature 'Admin Groups', feature: true do
let(:internal) { Gitlab::VisibilityLevel::INTERNAL }
let(:user) { create :user }
let!(:group) { create :group }
let!(:current_user) { gitlab_sign_in :admin }
let!(:current_user) { create(:admin) }
before do
sign_in(current_user)
stub_application_setting(default_group_visibility: internal)
end
......
......@@ -5,7 +5,7 @@ feature "Admin Health Check", feature: true do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
gitlab_sign_in :admin
sign_in(create(:admin))
end
describe '#show' do
......
......@@ -6,7 +6,7 @@ feature 'Admin::HookLogs', feature: true do
let(:hook_log) { create(:web_hook_log, web_hook: system_hook, internal_error_message: 'some error') }
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
scenario 'show list of hook logs' do
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Admin::Hooks', feature: true do
before do
@project = create(:project)
gitlab_sign_in :admin
sign_in(create(:admin))
@system_hook = create(:system_hook)
end
......
......@@ -5,7 +5,7 @@ RSpec.describe 'admin issues labels' do
let!(:feature_label) { Label.create(title: 'feature', template: true) }
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
describe 'list' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'admin manage applications', feature: true do
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
it do
......
......@@ -5,8 +5,10 @@ describe "Admin::Projects", feature: true do
let(:user) { create :user }
let!(:project) { create(:project) }
let!(:current_user) do
gitlab_sign_in :admin
let!(:current_user) { create(:admin) }
before do
sign_in(current_user)
end
describe "GET /admin/projects" do
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Admin::RequestsProfilesController', feature: true do
before do
FileUtils.mkdir_p(Gitlab::RequestProfiler::PROFILES_DIR)
gitlab_sign_in(:admin)
sign_in(create(:admin))
end
after do
......
......@@ -5,7 +5,7 @@ describe "Admin Runners" do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
gitlab_sign_in :admin
sign_in(create(:admin))
end
describe "Runners page" do
......
......@@ -5,7 +5,7 @@ feature 'Admin updates settings', feature: true do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
gitlab_sign_in :admin
sign_in(create(:admin))
visit admin_application_settings_path
end
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Admin System Info' do
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
describe 'GET /admin/system_info' do
......
......@@ -13,7 +13,7 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do
end
before do
gitlab_sign_in(admin)
sign_in(admin)
end
describe "token creation" do
......
......@@ -5,7 +5,11 @@ describe "Admin::Users", feature: true do
create(:omniauth_user, provider: 'twitter', extern_uid: '123456')
end
let!(:current_user) { gitlab_sign_in :admin }
let!(:current_user) { create(:admin) }
before do
sign_in(current_user)
end
describe "GET /admin/users" do
before do
......
......@@ -5,7 +5,7 @@ feature 'Admin uses repository checks', feature: true do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
gitlab_sign_in :admin
sign_in(create(:admin))
end
scenario 'to trigger a single check' do
......
......@@ -15,7 +15,7 @@ describe 'Issues Feed', feature: true do
context 'when authenticated' do
it 'renders atom feed' do
gitlab_sign_in user
sign_in user
visit namespace_project_issues_path(project.namespace, project, :atom)
expect(response_headers['Content-Type'])
......
......@@ -7,7 +7,7 @@ describe 'Auto deploy' do
before do
create :kubernetes_service, project: project
project.team << [user, :master]
gitlab_sign_in user
sign_in user
end
context 'when no deployment service is active' do
......
......@@ -14,7 +14,7 @@ describe 'Issue Boards add issue modal', :feature, :js do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
......
......@@ -12,7 +12,7 @@ describe 'Issue Boards', feature: true, js: true do
project.team << [user, :master]
project.team << [user2, :master]
gitlab_sign_in(user)
sign_in(user)
end
context 'no lists' do
......@@ -519,7 +519,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'signed out user' do
before do
gitlab_sign_out
sign_out(:user)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
end
......@@ -542,8 +542,8 @@ describe 'Issue Boards', feature: true, js: true do
before do
project.team << [user_guest, :guest]
gitlab_sign_out
gitlab_sign_in(user_guest)
sign_out(:user)
sign_in(user_guest)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
end
......
......@@ -15,7 +15,7 @@ describe 'Issue Boards', :feature, :js do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
end
context 'un-ordered issues' do
......
......@@ -6,7 +6,7 @@ describe 'Issue Boards shortcut', feature: true, js: true do
before do
create(:board, project: project)
gitlab_sign_in :admin
sign_in(create(:admin))
visit namespace_project_path(project.namespace, project)
end
......
......@@ -12,7 +12,7 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
end
it 'shows empty state when no results found' do
......
......@@ -10,7 +10,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
......
......@@ -20,7 +20,7 @@ describe 'Issue Boards', feature: true, js: true do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
......
......@@ -13,7 +13,7 @@ describe 'Sub-group project issue boards', :feature, :js do
before do
project.add_master(user)
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_board_path(project.namespace, project, board)
wait_for_requests
......
......@@ -68,7 +68,7 @@ feature 'Contributions Calendar', :feature, :js do
end
before do
gitlab_sign_in user
sign_in user
end
describe 'calendar day selection' do
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'CI Lint', js: true do
before do
gitlab_sign_in :user
sign_in(create(:user))
end
describe 'YAML parsing' do
......
......@@ -9,7 +9,7 @@ describe "Container Registry" do
end
before do
gitlab_sign_in(user)
sign_in(user)
project.add_developer(user)
stub_container_registry_config(enabled: true)
stub_container_registry_tags(repository: :any, tags: [])
......
......@@ -6,7 +6,7 @@ describe 'Copy as GFM', feature: true, js: true do
include ActionView::Helpers::JavaScriptHelper
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
describe 'Copying rendered GFM' do
......
......@@ -14,7 +14,7 @@ feature 'Cycle Analytics', feature: true, js: true do
before do
project.add_master(user)
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_cycle_analytics_path(project.namespace, project)
wait_for_requests
......@@ -38,7 +38,7 @@ feature 'Cycle Analytics', feature: true, js: true do
create_cycle
deploy_master
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_cycle_analytics_path(project.namespace, project)
end
......@@ -70,7 +70,7 @@ feature 'Cycle Analytics', feature: true, js: true do
user.update_attribute(:preferred_language, 'es')
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_cycle_analytics_path(project.namespace, project)
wait_for_requests
end
......@@ -93,7 +93,7 @@ feature 'Cycle Analytics', feature: true, js: true do
create_cycle
deploy_master
gitlab_sign_in(guest)
sign_in(guest)
visit namespace_project_cycle_analytics_path(project.namespace, project)
wait_for_requests
end
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Active Tab', js: true, feature: true do
before do
gitlab_sign_in :user
sign_in(create(:user))
end
shared_examples 'page has active tab' do |title|
......
require 'spec_helper'
RSpec.describe 'Dashboard Activity', feature: true do
let(:user) { create(:user) }
before do
gitlab_sign_in(create :user)
sign_in(user)
visit activity_dashboard_path
end
......
......@@ -9,7 +9,7 @@ RSpec.describe 'Dashboard Archived Project', feature: true do
project.team << [user, :master]
archived_project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
visit dashboard_projects_path
end
......
......@@ -13,7 +13,7 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do
Event.create( project: project, author_id: user.id, action: Event::JOINED,
updated_at: created_date, created_at: created_date)
gitlab_sign_in user
sign_in user
visit user_path(user)
wait_for_requests()
......@@ -30,7 +30,7 @@ feature 'Tooltips on .timeago dates', feature: true, js: true do
project.team << [user, :master]
create(:snippet, author: user, updated_at: created_date, created_at: created_date)
gitlab_sign_in user
sign_in user
visit user_snippets_path(user)
wait_for_requests()
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Group', feature: true do
before do
gitlab_sign_in(:user)
sign_in(create(:user))
end
it 'creates new group', js: true do
......
......@@ -10,7 +10,7 @@ describe 'Dashboard Groups page', js: true, feature: true do
group.add_owner(user)
nested_group.add_owner(user)
gitlab_sign_in(user)
sign_in(user)
visit dashboard_groups_path
expect(page).to have_content(group.full_name)
......@@ -23,7 +23,7 @@ describe 'Dashboard Groups page', js: true, feature: true do
group.add_owner(user)
nested_group.add_owner(user)
gitlab_sign_in(user)
sign_in(user)
visit dashboard_groups_path
end
......@@ -58,7 +58,7 @@ describe 'Dashboard Groups page', js: true, feature: true do
group.add_owner(user)
subgroup.add_owner(user)
gitlab_sign_in(user)
sign_in(user)
visit dashboard_groups_path
end
......@@ -98,7 +98,7 @@ describe 'Dashboard Groups page', js: true, feature: true do
allow(Kaminari.config).to receive(:default_per_page).and_return(1)
gitlab_sign_in(user)
sign_in(user)
visit dashboard_groups_path
end
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Help', feature: true do
before do
gitlab_sign_in(:user)
sign_in(create(:user))
end
it 'renders correctly markdown' do
......
......@@ -9,7 +9,7 @@ describe 'Navigation bar counter', feature: true, caching: true do
before do
issue.assignees = [user]
merge_request.update(assignee: user)
gitlab_sign_in(user)
sign_in(user)
end
it 'reflects dashboard issues count' do
......
......@@ -2,6 +2,7 @@ require 'spec_helper'
RSpec.describe 'Dashboard Issues', feature: true do
let(:current_user) { create :user }
let(:user) { current_user } # Shared examples depend on this being available
let!(:public_project) { create(:empty_project, :public) }
let(:project) { create(:empty_project) }
let(:project_with_issues_disabled) { create(:empty_project, :issues_disabled) }
......@@ -12,7 +13,7 @@ RSpec.describe 'Dashboard Issues', feature: true do
before do
[project, project_with_issues_disabled].each { |project| project.team << [current_user, :master] }
gitlab_sign_in(current_user)
sign_in(current_user)
visit issues_dashboard_path(assignee_id: current_user.id)
end
......
......@@ -11,7 +11,7 @@ describe 'Dashboard > label filter', feature: true, js: true do
project.labels << label
project2.labels << label2
gitlab_sign_in(user)
sign_in(user)
visit issues_dashboard_path
end
......
......@@ -11,7 +11,7 @@ feature 'Dashboard > milestone filter', :feature, :js do
let!(:issue2) { create :issue, author: user, project: project, milestone: milestone2 }
before do
gitlab_sign_in(user)
sign_in(user)
visit issues_dashboard_path(author_id: user.id)
end
......
......@@ -15,7 +15,7 @@ describe 'Dashboard milestone tabs', :js, :feature do
before do
project.add_master(user)
gitlab_sign_in(user)
sign_in(user)
visit dashboard_milestone_path(milestone.safe_title, title: milestone.title)
end
......
......@@ -7,7 +7,13 @@ RSpec.describe 'Dashboard Projects', feature: true do
before do
project.team << [user, :developer]
gitlab_sign_in(user)
sign_in(user)
end
it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token" do
before do
visit dashboard_projects_path
end
end
it 'shows the project the user in a member of in the list' do
......@@ -63,6 +69,4 @@ RSpec.describe 'Dashboard Projects', feature: true do
expect(page).to have_xpath("//a[@href='#{pipelines_namespace_project_commit_path(project.namespace, project, project.commit)}']")
end
end
it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
end
......@@ -3,7 +3,7 @@ require 'spec_helper'
feature 'Dashboard shortcuts', :feature, :js do
context 'logged in' do
before do
gitlab_sign_in :user
sign_in(create(:user))
visit root_dashboard_path
end
......
......@@ -6,7 +6,7 @@ describe 'Dashboard snippets', feature: true do
let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) }
before do
allow(Snippet).to receive(:default_per_page).and_return(1)
gitlab_sign_in(project.owner)
sign_in(project.owner)
visit dashboard_snippets_path
end
......@@ -25,7 +25,7 @@ describe 'Dashboard snippets', feature: true do
end
before do
gitlab_sign_in(user)
sign_in(user)
visit dashboard_snippets_path
end
......
......@@ -83,7 +83,7 @@ feature 'Dashboard > User sorts todos' do
create(:todo, user: user, project: project, target: issue_2)
create(:todo, user: user, project: project, target: merge_request_1)
gitlab_sign_in(user)
sign_in(user)
visit dashboard_todos_path
end
......
......@@ -9,7 +9,7 @@ describe 'Dashboard > User filters projects', :feature do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
end
describe 'filtering personal projects' do
......
......@@ -8,7 +8,7 @@ describe "Dashboard Issues filtering", feature: true, js: true do
context 'filtering by milestone' do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
create(:issue, project: project, author: user, assignees: [user])
create(:issue, project: project, author: user, assignees: [user], milestone: milestone)
......
......@@ -17,7 +17,7 @@ feature 'Dashboard > Milestones', feature: true do
let!(:milestone) { create(:milestone, project: project) }
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
visit dashboard_milestones_path
end
......
......@@ -9,7 +9,7 @@ describe 'Discussion Comments Merge Request', :feature, :js do
before do
project.add_master(user)
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_commit_path(project.namespace, project, sample_commit.id)
end
......
......@@ -7,7 +7,7 @@ describe 'Discussion Comments Issue', :feature, :js do
before do
project.add_master(user)
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue)
end
......
......@@ -7,7 +7,7 @@ describe 'Discussion Comments Merge Request', :feature, :js do
before do
project.add_master(user)
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
end
......
......@@ -7,7 +7,7 @@ describe 'Discussion Comments Issue', :feature, :js do
before do
project.add_master(user)
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_snippet_path(project.namespace, project, snippet)
end
......
......@@ -10,7 +10,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do
allow(Gitlab::Git::Diff).to receive(:size_limit).and_return(100.kilobytes)
allow(Gitlab::Git::Diff).to receive(:collapse_limit).and_return(10.kilobytes)
gitlab_sign_in :admin
sign_in(create(:admin))
# Ensure that undiffable.md is in .gitattributes
project.repository.copy_gitattributes(branch)
......
......@@ -10,7 +10,7 @@ describe 'Explore Groups page', :js, :feature do
before do
group.add_owner(user)
gitlab_sign_in(user)
sign_in(user)
visit explore_groups_path
end
......
......@@ -16,7 +16,7 @@ feature 'Top Plus Menu', feature: true, js: true do
context 'used by full user' do
before do
gitlab_sign_in(user)
sign_in(user)
end
scenario 'click on New project shows new project page' do
......@@ -103,7 +103,7 @@ feature 'Top Plus Menu', feature: true, js: true do
context 'used by guest user' do
before do
gitlab_sign_in(guest_user)
sign_in(guest_user)
end
scenario 'click on New issue shows new issue page' do
......
......@@ -6,7 +6,7 @@ feature 'Global search', feature: true do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
end
describe 'I search through the issues and I see pagination' do
......
require 'spec_helper'
feature 'Group activity page', feature: true do
let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user }
let(:group) { create(:group) }
let(:path) { activity_group_path(group) }
context 'when signed in' do
before do
user = create(:group_member, :developer, user: create(:user), group: group ).user
gitlab_sign_in(user)
sign_in(user)
visit path
end
......
......@@ -5,7 +5,7 @@ feature 'Groups Merge Requests Empty States' do
let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user }
before do
gitlab_sign_in(user)
sign_in(user)
end
context 'group has a project' do
......
......@@ -9,7 +9,7 @@ feature 'Group name toggle', feature: true, js: true do
SMALL_SCREEN = 300
before do
gitlab_sign_in :user
sign_in(create(:user))
end
it 'is not present if enough horizontal space' do
......
......@@ -6,7 +6,7 @@ feature 'Edit group settings', feature: true do
background do
group.add_owner(user)
gitlab_sign_in(user)
sign_in(user)
end
describe 'when the group path is changed' do
......
......@@ -7,7 +7,7 @@ feature 'Edit group label', feature: true do
background do
group.add_owner(user)
gitlab_sign_in(user)
sign_in(user)
visit edit_group_label_path(group, label)
end
......
......@@ -8,7 +8,7 @@ feature 'Groups > Members > Manage access requests', feature: true do
background do
group.request_access(user)
group.add_owner(owner)
gitlab_sign_in(owner)
sign_in(owner)
end
scenario 'owner can see access requests' do
......
......@@ -8,7 +8,7 @@ feature 'Groups > Members > Manage members', feature: true do
let(:group) { create(:group) }
background do
gitlab_sign_in(user1)
sign_in(user1)
end
scenario 'update user to owner level', :js do
......
......@@ -8,7 +8,7 @@ feature 'Groups > Members > Request access', feature: true do
background do
group.add_owner(owner)
gitlab_sign_in(user)
sign_in(user)
visit group_path(group)
end
......
......@@ -9,7 +9,7 @@ feature 'Groups > Members > Sort members', feature: true do
create(:group_member, :owner, user: owner, group: group, created_at: 5.days.ago)
create(:group_member, :developer, user: developer, group: group, created_at: 3.days.ago)
gitlab_sign_in(owner)
sign_in(owner)
end
scenario 'sorts alphabetically by default' do
......
......@@ -8,7 +8,7 @@ feature 'Group milestones', :feature, :js do
before do
Timecop.freeze
gitlab_sign_in(user)
sign_in(user)
end
after do
......
......@@ -5,9 +5,12 @@ feature 'Group show page', feature: true do
let(:path) { group_path(group) }
context 'when signed in' do
let(:user) do
create(:group_member, :developer, user: create(:user), group: group ).user
end
before do
user = create(:group_member, :developer, user: create(:user), group: group ).user
gitlab_sign_in(user)
sign_in(user)
visit path
end
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
feature 'Group', feature: true do
before do
gitlab_sign_in(:admin)
sign_in(create(:admin))
end
matcher :have_namespace_error_message do
......@@ -108,8 +108,8 @@ feature 'Group', feature: true do
before do
group.add_owner(user)
gitlab_sign_out
gitlab_sign_in(user)
sign_out(:user)
sign_in(user)
visit subgroups_group_path(group)
click_link 'New Subgroup'
......@@ -128,8 +128,8 @@ feature 'Group', feature: true do
it 'checks permissions to avoid exposing groups by parent_id' do
group = create(:group, :private, path: 'secret-group')
gitlab_sign_out
gitlab_sign_in(:user)
sign_out(:user)
sign_in(create(:user))
visit new_group_path(parent_id: group.id)
expect(page).not_to have_content('secret-group')
......
......@@ -40,7 +40,7 @@ describe 'Help Pages', feature: true do
allow_any_instance_of(ApplicationSetting).to receive(:version_check_enabled) { true }
allow_any_instance_of(VersionCheck).to receive(:url) { '/version-check-url' }
gitlab_sign_in :user
sign_in(create(:user))
visit help_path
end
......@@ -60,7 +60,7 @@ describe 'Help Pages', feature: true do
allow_any_instance_of(ApplicationSetting).to receive(:help_page_text) { "My Custom Text" }
allow_any_instance_of(ApplicationSetting).to receive(:help_page_support_url) { "http://example.com/help" }
gitlab_sign_in(:user)
sign_in(create(:user))
visit help_path
end
......
......@@ -8,7 +8,7 @@ describe 'issuable list', feature: true do
before do
project.add_user(user, :developer)
gitlab_sign_in(user)
sign_in(user)
issuable_types.each { |type| create_issuables(type) }
end
......
......@@ -12,7 +12,7 @@ describe 'Awards Emoji', feature: true do
context 'authorized user' do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
end
describe 'visiting an issue with a legacy award emoji that is not valid anymore' do
......
......@@ -7,7 +7,7 @@ feature 'Issue awards', js: true, feature: true do
describe 'logged in' do
before do
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue)
wait_for_requests
end
......
......@@ -13,7 +13,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
before do
project.team << [user, :master]
gitlab_sign_in user
sign_in user
end
context 'sidebar' do
......@@ -346,7 +346,7 @@ feature 'Issues > Labels bulk assignment', feature: true do
context 'as a guest' do
before do
gitlab_sign_in user
sign_in user
visit namespace_project_issues_path(project.namespace, project)
end
......
......@@ -8,7 +8,7 @@ feature 'Create Branch/Merge Request Dropdown on issue page', feature: true, js:
context 'for team members' do
before do
project.team << [user, :developer]
gitlab_sign_in(user)
sign_in(user)
end
it 'allows creating a merge request from the issue page' do
......
......@@ -9,7 +9,7 @@ feature 'Resolving all open discussions in a merge request from an issue', featu
describe 'as a user with access to the project' do
before do
project.team << [user, :master]
gitlab_sign_in user
sign_in user
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
end
......@@ -82,7 +82,7 @@ feature 'Resolving all open discussions in a merge request from an issue', featu
describe 'as a reporter' do
before do
project.team << [user, :reporter]
gitlab_sign_in user
sign_in user
visit new_namespace_project_issue_path(project.namespace, project, merge_request_to_resolve_discussions_of: merge_request.iid)
end
......
......@@ -9,7 +9,7 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe
describe 'As a user with access to the project' do
before do
project.team << [user, :master]
gitlab_sign_in user
sign_in user
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
end
......@@ -66,7 +66,7 @@ feature 'Resolve an open discussion in a merge request by creating an issue', fe
describe 'as a reporter' do
before do
project.team << [user, :reporter]
gitlab_sign_in user
sign_in user
visit new_namespace_project_issue_path(project.namespace, project,
merge_request_to_resolve_discussions_of: merge_request.iid,
discussion_to_resolve: discussion.id)
......
......@@ -23,7 +23,7 @@ describe 'Dropdown assignee', :feature, :js do
project.team << [user, :master]
project.team << [user_john, :master]
project.team << [user_jacob, :master]
gitlab_sign_in(user)
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
......
......@@ -31,7 +31,7 @@ describe 'Dropdown author', js: true, feature: true do
project.team << [user, :master]
project.team << [user_john, :master]
project.team << [user_jacob, :master]
gitlab_sign_in(user)
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
......
......@@ -14,7 +14,7 @@ describe 'Dropdown hint', :js, :feature do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
......
......@@ -34,7 +34,7 @@ describe 'Dropdown label', js: true, feature: true do
before do
project.add_master(user)
gitlab_sign_in(user)
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
......
......@@ -30,7 +30,7 @@ describe 'Dropdown milestone', :feature, :js do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
......
......@@ -9,7 +9,7 @@ describe 'Search bar', js: true, feature: true do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
......
......@@ -25,7 +25,7 @@ describe 'Visual tokens', js: true, feature: true do
before do
project.add_user(user, :master)
project.add_user(user_rock, :master)
gitlab_sign_in(user)
sign_in(user)
create(:issue, project: project)
visit namespace_project_issues_path(project.namespace, project)
......
......@@ -16,7 +16,7 @@ describe 'New/edit issue', :feature, :js do
before do
project.team << [user, :master]
project.team << [user2, :master]
gitlab_sign_in(user)
sign_in(user)
end
context 'new issue' do
......
......@@ -8,7 +8,7 @@ feature 'GFM autocomplete', feature: true, js: true do
before do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue)
wait_for_requests
......
......@@ -10,7 +10,7 @@ feature 'Issue Sidebar', feature: true do
let!(:label) { create(:label, project: project, title: 'bug') }
before do
gitlab_sign_in(user)
sign_in(user)
end
context 'assignee', js: true do
......
......@@ -6,7 +6,7 @@ feature 'Issue markdown toolbar', feature: true, js: true do
let(:user) { create(:user) }
before do
gitlab_sign_in(user)
sign_in(user)
visit namespace_project_issue_path(project.namespace, project, issue)
end
......
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