Commit b99c7a1d authored by Kamil Trzcinski's avatar Kamil Trzcinski

Merge remote-tracking branch...

Merge remote-tracking branch 'origin-ee/feature/intermediate/32568-adding-variables-to-pipelines-schedules-ee' into ce-to-ee-2017-07-08
parents e19da3f9 0dc2ca3a
......@@ -543,3 +543,4 @@ gitlab_git_test:
SETUP_DB: "false"
script:
- spec/support/prepare-gitlab-git-test-for-commit --check-for-changes
<<: *except-docs
......@@ -11,7 +11,18 @@ module Projects
@hook = ProjectHook.new
# Services
@services = @project.find_or_initialize_services
@services = @project.find_or_initialize_services(exceptions: service_exceptions)
end
private
# Returns a list of services that should be hidden from the list
def service_exceptions
if current_application_settings.slack_app_enabled
['slack_slash_commands']
else
['gitlab_slack_application']
end
end
end
end
......
......@@ -4,6 +4,7 @@ module Ci
include HasVariable
include Presentable
prepend EE::Ci::Variable
include Presentable
belongs_to :project
......
......@@ -800,10 +800,12 @@ class Project < ActiveRecord::Base
update_column(:has_external_wiki, services.external_wikis.any?)
end
def find_or_initialize_services
def find_or_initialize_services(exceptions: [])
services_templates = Service.where(template: true)
Service.available_services_names.map do |service_name|
available_services_names = Service.available_services_names - exceptions
available_services_names.map do |service_name|
service = find_service(services, service_name)
if service
......
......@@ -246,6 +246,7 @@ class Service < ActiveRecord::Base
pushover
redmine
slack
slack_slash_commands
teamcity
microsoft_teams
]
......@@ -253,14 +254,10 @@ class Service < ActiveRecord::Base
service_names += %w[mock_ci mock_deployment mock_monitoring]
end
if show_gitlab_slack_application?
if Gitlab.com? || Rails.env.development?
service_names.push('gitlab_slack_application')
end
unless Gitlab.com?
service_names.push('slack_slash_commands')
end
service_names.sort_by(&:downcase)
end
......@@ -271,10 +268,6 @@ class Service < ActiveRecord::Base
service
end
def self.show_gitlab_slack_application?
(Gitlab.com? && current_application_settings.slack_app_enabled) || Rails.env.development?
end
private
def cache_project_has_external_issue_tracker
......
%h4.prepend-top-0
Secret variables
= link_to icon('question-circle'), help_page_path('ci/variables/README', anchor: 'secret-variables'), target: '_blank'
- if @project.feature_available?(:variable_environment_scope)
- if @variable.respond_to?(:environment_scope) && @project.feature_available?(:variable_environment_scope)
%p
These variables will be set to environment by the runner, and could be protected by exposing only to protected branches or tags, or some particular environments.
- else
......
......@@ -7,7 +7,8 @@
.form-group
= f.label :value, "Value", class: "label-light"
= f.text_area :value, class: "form-control", placeholder: @variable.placeholder
= render 'projects/variables/ee/environment_scope', f: f
- if @variable.respond_to?(:environment_scope)
= render 'projects/variables/ee/environment_scope', f: f
.form-group
.checkbox
= f.label :protected do
......
......@@ -9,7 +9,7 @@
%th Key
%th Value
%th Protected
- if @project.feature_available?(:variable_environment_scope)
- if @variable.respond_to?(:environment_scope) && @project.feature_available?(:variable_environment_scope)
%th Environment scope
%th
%tbody
......@@ -19,7 +19,7 @@
%td.variable-key= variable.key
%td.variable-value{ "data-value" => variable.value }******
%td.variable-protected= Gitlab::Utils.boolean_to_yes_no(variable.protected)
- if @project.feature_available?(:variable_environment_scope)
- if @variable.respond_to?(:environment_scope) && @project.feature_available?(:variable_environment_scope)
%td.variable-environment-scope= variable.environment_scope
%td.variable-menu
= link_to variable.edit_path, class: "btn btn-transparent btn-variable-edit" do
......
......@@ -13,5 +13,4 @@
by entering
%kbd.inline /gitlab help
- unless @service.template?
%p To set up this service press "Add to Slack"
= render "projects/services/#{@service.to_param}/slack_integration_form"
= render "projects/services/#{@service.to_param}/slack_button"
- slack_integration = @service.slack_integration
- if slack_integration
%table.table
......@@ -26,3 +25,6 @@
- project = @service.project
= link_to 'Edit', edit_project_settings_slack_path(project), class: 'btn btn-sm'
= link_to 'Remove', project_settings_slack_path(project), method: :delete, class: 'btn btn-danger btn-sm', data: { confirm: 'Are you sure?' }
- else
%p To set up this service press "Add to Slack"
= render "projects/services/#{@service.to_param}/slack_button"
......@@ -17,4 +17,27 @@ describe Projects::Settings::IntegrationsController do
expect(response).to render_template(:show)
end
end
context 'Sets correct services list' do
it 'enables SlackSlashCommandsService and disables GitlabSlackApplication' do
get :show, namespace_id: project.namespace, project_id: project
services = assigns(:services).map(&:type)
expect(services).to include('SlackSlashCommandsService')
expect(services).not_to include('GitlabSlackApplicationService')
end
it 'enables GitlabSlackApplication and disables SlackSlashCommandsService' do
stub_application_setting(slack_app_enabled: true)
allow(::Gitlab).to receive(:com?).and_return(true)
get :show, namespace_id: project.namespace, project_id: project
services = assigns(:services).map(&:type)
expect(services).to include('GitlabSlackApplicationService')
expect(services).not_to include('SlackSlashCommandsService')
end
end
end
......@@ -24,7 +24,7 @@ describe Projects::Settings::SlacksController do
.to receive(:new).with(project, user, anything).and_return(service)
end
it 'calls service and redirects with no flash message if result is successful' do
it 'calls service and redirects with no alerts if result is successful' do
stub_service(status: :success)
get :slack_auth, namespace_id: project.namespace, project_id: project
......@@ -34,7 +34,7 @@ describe Projects::Settings::SlacksController do
expect(flash[:alert]).to be_nil
end
it 'calls service and redirects with flash message if there is error' do
it 'calls service and redirects with the alert if there is error' do
stub_service(status: :error, message: 'error')
get :slack_auth, namespace_id: project.namespace, project_id: project
......
......@@ -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)
......
......@@ -6,7 +6,7 @@ describe 'Admin::AuditLogs', feature: true, js: true do
let(:user) { create(:user) }
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
describe 'user events' do
......
......@@ -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)
......
require 'spec_helper'
describe "Admin::Emails", feature: true, js: true do
let!(:current_user) { gitlab_sign_in :admin }
let!(:current_user) { create(:admin) }
let!(:group) { create(:group) }
let!(:project) { create(:project, namespace: group) }
describe "GET /admin/email" do
before do
sign_in(current_user)
visit admin_email_path
end
......
......@@ -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'
feature "License Admin", feature: true do
before do
gitlab_sign_in :admin
sign_in(create(:admin))
end
describe '#show' 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 project_issues_path(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 project_board_path(project, board)
wait_for_requests
......
......@@ -10,7 +10,7 @@ describe 'Board with milestone', :feature, :js do
before do
project.team << [user, :master]
login_as(user)
sign_in(user)
end
context 'with the feature enabled' do
......
......@@ -14,7 +14,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
......@@ -537,7 +537,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'signed out user' do
before do
gitlab_sign_out
sign_out(:user)
visit project_boards_path(project)
wait_for_requests
end
......@@ -560,8 +560,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 project_boards_path(project)
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 project_path(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 project_board_path(project, board)
wait_for_requests
......
......@@ -21,7 +21,7 @@ describe 'Issue Boards', feature: true, js: true do
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
visit project_board_path(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 project_board_path(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 @@ feature 'CI shared runner settings', feature: true do
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
gitlab_sign_in(admin)
sign_in(admin)
end
context 'without global shared runners quota' do
......
......@@ -6,7 +6,7 @@ feature 'CI shared runner limits', feature: true do
let(:group) { create(:group) }
before do
gitlab_sign_in(user)
sign_in(user)
end
context 'when project member' 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 project_cycle_analytics_path(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 project_cycle_analytics_path(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 project_cycle_analytics_path(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 project_cycle_analytics_path(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 @@ feature 'Dashboard Projects' 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
......@@ -71,6 +77,4 @@ feature 'Dashboard Projects' do
expect(page).to have_xpath("//a[@href='#{pipelines_project_commit_path(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 project_commit_path(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 project_issue_path(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 project_merge_request_path(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 project_snippet_path(project, snippet)
end
......
......@@ -9,7 +9,7 @@ feature 'Global elastic search', feature: true do
Gitlab::Elastic::Helper.create_empty_index
project.team << [user, :master]
gitlab_sign_in(user)
sign_in(user)
end
after do
......
......@@ -21,7 +21,7 @@ feature 'Group elastic search', js: true, feature: true do
project.team << [user, :master]
group.add_owner(user)
gitlab_sign_in(user)
sign_in(user)
end
after 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(: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
......
......@@ -7,7 +7,7 @@ feature 'Groups > Contribution Analytics', js: true, feature: true do
before do
group.add_owner(user)
gitlab_sign_in(user)
sign_in(user)
end
describe 'visit Contribution Analytics page for group' do
......
......@@ -8,7 +8,7 @@ feature 'Groups > Audit Events', js: true, feature: true do
before do
group.add_owner(user)
group.add_developer(pete)
gitlab_sign_in(user)
sign_in(user)
end
describe 'changing a user access level' do
......
......@@ -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
......
......@@ -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!
allow(Gitlab.config.ldap).to receive_messages(enabled: true)
gitlab_sign_in(owner)
sign_in(owner)
end
scenario 'override not available on project members page', js: true 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
......
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