Commit 2efd3a0a authored by Thong Kuah's avatar Thong Kuah

Merge branch 'rc/update_gitlab_styles_with_changes' into 'master'

Rc/update gitlab styles with changes

See merge request gitlab-org/gitlab!21886
parents de2c9df1 7a7403b7
...@@ -299,3 +299,76 @@ Graphql/Descriptions: ...@@ -299,3 +299,76 @@ Graphql/Descriptions:
RSpec/AnyInstanceOf: RSpec/AnyInstanceOf:
Enabled: false Enabled: false
# Cops for upgrade to gitlab-styles 3.1.0
FactoryBot/FactoryClassName:
Enabled: false
FactoryBot/CreateList:
Enabled: false
Rails/SafeNavigationWithBlank:
Enabled: false
Rails/ApplicationController:
Enabled: false
Rails/ApplicationMailer:
Enabled: false
Rails/RakeEnvironment:
Enabled: false
Rails/HelperInstanceVariable:
Enabled: false
Rails/EnumHash:
Enabled: false
RSpec/ReceiveCounts:
Enabled: false
RSpec/ContextMethod:
Enabled: false
RSpec/ImplicitSubject:
Enabled: false
RSpec/LeakyConstantDeclaration:
Enabled: false
RSpec/EmptyLineAfterHook:
Enabled: false
RSpec/HooksBeforeExamples:
Enabled: false
RSpec/EmptyLineAfterExample:
Enabled: false
RSpec/Be:
Enabled: false
RSpec/DescribedClass:
Enabled: false
RSpec/SharedExamples:
Enabled: false
RSpec/EmptyLineAfterExampleGroup:
Enabled: false
RSpec/ReceiveNever:
Enabled: false
RSpec/MissingExampleGroupArgument:
Enabled: false
RSpec/UnspecifiedException:
Enabled: false
Style/MultilineWhenThen:
Enabled: false
Style/FloatDivision:
Enabled: false
\ No newline at end of file
...@@ -366,11 +366,11 @@ group :development, :test do ...@@ -366,11 +366,11 @@ group :development, :test do
gem 'spring', '~> 2.0.0' gem 'spring', '~> 2.0.0'
gem 'spring-commands-rspec', '~> 1.0.4' gem 'spring-commands-rspec', '~> 1.0.4'
gem 'gitlab-styles', '~> 2.7', require: false gem 'gitlab-styles', '~> 3.1.0', require: false
# Pin these dependencies, otherwise a new rule could break the CI pipelines # Pin these dependencies, otherwise a new rule could break the CI pipelines
gem 'rubocop', '~> 0.69.0' gem 'rubocop', '~> 0.74.0'
gem 'rubocop-performance', '~> 1.1.0' gem 'rubocop-performance', '~> 1.4.1'
gem 'rubocop-rspec', '~> 1.22.1' gem 'rubocop-rspec', '~> 1.37.0'
gem 'scss_lint', '~> 0.56.0', require: false gem 'scss_lint', '~> 0.56.0', require: false
gem 'haml_lint', '~> 0.34.0', require: false gem 'haml_lint', '~> 0.34.0', require: false
......
...@@ -379,11 +379,12 @@ GEM ...@@ -379,11 +379,12 @@ GEM
gitlab-puma (>= 2.7, < 5) gitlab-puma (>= 2.7, < 5)
gitlab-sidekiq-fetcher (0.5.2) gitlab-sidekiq-fetcher (0.5.2)
sidekiq (~> 5) sidekiq (~> 5)
gitlab-styles (2.8.0) gitlab-styles (3.1.0)
rubocop (~> 0.69.0) rubocop (~> 0.74.0)
rubocop-gitlab-security (~> 0.1.0) rubocop-gitlab-security (~> 0.1.0)
rubocop-performance (~> 1.1.0) rubocop-performance (~> 1.4.1)
rubocop-rspec (~> 1.19) rubocop-rails (~> 2.0)
rubocop-rspec (~> 1.36)
gitlab_chronic_duration (0.10.6.2) gitlab_chronic_duration (0.10.6.2)
numerizer (~> 0.2) numerizer (~> 0.2)
gitlab_omniauth-ldap (2.1.1) gitlab_omniauth-ldap (2.1.1)
...@@ -519,7 +520,7 @@ GEM ...@@ -519,7 +520,7 @@ GEM
jaeger-client (0.10.0) jaeger-client (0.10.0)
opentracing (~> 0.3) opentracing (~> 0.3)
thrift thrift
jaro_winkler (1.5.3) jaro_winkler (1.5.4)
jira-ruby (1.7.1) jira-ruby (1.7.1)
activesupport activesupport
atlassian-jwt atlassian-jwt
...@@ -726,8 +727,8 @@ GEM ...@@ -726,8 +727,8 @@ GEM
rubypants (~> 0.2) rubypants (~> 0.2)
orm_adapter (0.5.0) orm_adapter (0.5.0)
os (1.0.0) os (1.0.0)
parallel (1.17.0) parallel (1.19.1)
parser (2.6.3.0) parser (2.6.5.0)
ast (~> 2.4.0) ast (~> 2.4.0)
parslet (1.8.2) parslet (1.8.2)
peek (1.1.0) peek (1.1.0)
...@@ -904,7 +905,7 @@ GEM ...@@ -904,7 +905,7 @@ GEM
pg pg
rails rails
sqlite3 sqlite3
rubocop (0.69.0) rubocop (0.74.0)
jaro_winkler (~> 1.5.1) jaro_winkler (~> 1.5.1)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 2.6) parser (>= 2.6)
...@@ -913,10 +914,13 @@ GEM ...@@ -913,10 +914,13 @@ GEM
unicode-display_width (>= 1.4.0, < 1.7) unicode-display_width (>= 1.4.0, < 1.7)
rubocop-gitlab-security (0.1.1) rubocop-gitlab-security (0.1.1)
rubocop (>= 0.51) rubocop (>= 0.51)
rubocop-performance (1.1.0) rubocop-performance (1.4.1)
rubocop (>= 0.67.0) rubocop (>= 0.71.0)
rubocop-rspec (1.22.2) rubocop-rails (2.4.0)
rubocop (>= 0.52.1) rack (>= 1.1)
rubocop (>= 0.72.0)
rubocop-rspec (1.37.0)
rubocop (>= 0.68.1)
ruby-enum (0.7.2) ruby-enum (0.7.2)
i18n i18n
ruby-fogbugz (0.2.1) ruby-fogbugz (0.2.1)
...@@ -1207,7 +1211,7 @@ DEPENDENCIES ...@@ -1207,7 +1211,7 @@ DEPENDENCIES
gitlab-puma (~> 4.3.1.gitlab.2) gitlab-puma (~> 4.3.1.gitlab.2)
gitlab-puma_worker_killer (~> 0.1.1.gitlab.1) gitlab-puma_worker_killer (~> 0.1.1.gitlab.1)
gitlab-sidekiq-fetcher (= 0.5.2) gitlab-sidekiq-fetcher (= 0.5.2)
gitlab-styles (~> 2.7) gitlab-styles (~> 3.1.0)
gitlab_chronic_duration (~> 0.10.6.2) gitlab_chronic_duration (~> 0.10.6.2)
gitlab_omniauth-ldap (~> 2.1.1) gitlab_omniauth-ldap (~> 2.1.1)
gon (~> 6.2) gon (~> 6.2)
...@@ -1318,9 +1322,9 @@ DEPENDENCIES ...@@ -1318,9 +1322,9 @@ DEPENDENCIES
rspec-set (~> 0.1.3) rspec-set (~> 0.1.3)
rspec_junit_formatter rspec_junit_formatter
rspec_profiling (~> 0.0.5) rspec_profiling (~> 0.0.5)
rubocop (~> 0.69.0) rubocop (~> 0.74.0)
rubocop-performance (~> 1.1.0) rubocop-performance (~> 1.4.1)
rubocop-rspec (~> 1.22.1) rubocop-rspec (~> 1.37.0)
ruby-fogbugz (~> 0.2.1) ruby-fogbugz (~> 0.2.1)
ruby-prof (~> 1.0.0) ruby-prof (~> 1.0.0)
ruby-progressbar ruby-progressbar
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::SystemInfoController < Admin::ApplicationController class Admin::SystemInfoController < Admin::ApplicationController
EXCLUDED_MOUNT_OPTIONS = [ EXCLUDED_MOUNT_OPTIONS = %w[
'nobrowse', nobrowse
'read-only', read-only
'ro' ro
].freeze ].freeze
EXCLUDED_MOUNT_TYPES = [ EXCLUDED_MOUNT_TYPES = [
......
...@@ -31,7 +31,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController ...@@ -31,7 +31,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
# Extend the standard message generation to accept our custom exception # Extend the standard message generation to accept our custom exception
def failure_message def failure_message
exception = request.env["omniauth.error"] exception = request.env["omniauth.error"]
error = exception.error_reason if exception.respond_to?(:error_reason) error = exception.error_reason if exception.respond_to?(:error_reason)
error ||= exception.error if exception.respond_to?(:error) error ||= exception.error if exception.respond_to?(:error)
error ||= exception.message if exception.respond_to?(:message) error ||= exception.message if exception.respond_to?(:message)
error ||= request.env["omniauth.error.type"].to_s error ||= request.env["omniauth.error.type"].to_s
......
...@@ -7,8 +7,8 @@ class Projects::StarrersController < Projects::ApplicationController ...@@ -7,8 +7,8 @@ class Projects::StarrersController < Projects::ApplicationController
@starrers = UsersStarProjectsFinder.new(@project, params, current_user: @current_user).execute @starrers = UsersStarProjectsFinder.new(@project, params, current_user: @current_user).execute
@sort = params[:sort].presence || sort_value_name @sort = params[:sort].presence || sort_value_name
@starrers = @starrers.preload_users.sort_by_attribute(@sort).page(params[:page]) @starrers = @starrers.preload_users.sort_by_attribute(@sort).page(params[:page])
@public_count = @project.starrers.with_public_profile.size @public_count = @project.starrers.with_public_profile.size
@total_count = @project.starrers.size @total_count = @project.starrers.size
@private_count = @total_count - @public_count @private_count = @total_count - @public_count
end end
......
...@@ -35,7 +35,7 @@ module DashboardHelper ...@@ -35,7 +35,7 @@ module DashboardHelper
tag.p(aria: { label: label }) do tag.p(aria: { label: label }) do
concat(link_or_title) concat(link_or_title)
concat(tag.span(class: ['light', 'float-right']) do concat(tag.span(class: %w[light float-right]) do
boolean_to_icon(enabled) boolean_to_icon(enabled)
end) end)
......
...@@ -127,7 +127,7 @@ module SnippetsHelper ...@@ -127,7 +127,7 @@ module SnippetsHelper
return unless attrs = snippet_badge_attributes(snippet) return unless attrs = snippet_badge_attributes(snippet)
css_class, text = attrs css_class, text = attrs
tag.span(class: ['badge', 'badge-gray']) do tag.span(class: %w[badge badge-gray]) do
concat(tag.i(class: ['fa', css_class])) concat(tag.i(class: ['fa', css_class]))
concat(' ') concat(' ')
concat(text) concat(text)
......
...@@ -234,7 +234,7 @@ module Gitlab ...@@ -234,7 +234,7 @@ module Gitlab
credentials: true, credentials: true,
headers: :any, headers: :any,
methods: :any, methods: :any,
expose: ['Link', 'X-Total', 'X-Total-Pages', 'X-Per-Page', 'X-Page', 'X-Next-Page', 'X-Prev-Page'] expose: %w[Link X-Total X-Total-Pages X-Per-Page X-Page X-Next-Page X-Prev-Page]
end end
# Cross-origin requests must not have the session cookie available # Cross-origin requests must not have the session cookie available
...@@ -244,7 +244,7 @@ module Gitlab ...@@ -244,7 +244,7 @@ module Gitlab
credentials: false, credentials: false,
headers: :any, headers: :any,
methods: :any, methods: :any,
expose: ['Link', 'X-Total', 'X-Total-Pages', 'X-Per-Page', 'X-Page', 'X-Next-Page', 'X-Prev-Page'] expose: %w[Link X-Total X-Total-Pages X-Per-Page X-Page X-Next-Page X-Prev-Page]
end end
end end
......
...@@ -162,8 +162,8 @@ Settings.gitlab['default_projects_limit'] ||= 100000 ...@@ -162,8 +162,8 @@ Settings.gitlab['default_projects_limit'] ||= 100000
Settings.gitlab['default_branch_protection'] ||= 2 Settings.gitlab['default_branch_protection'] ||= 2
Settings.gitlab['default_can_create_group'] = true if Settings.gitlab['default_can_create_group'].nil? Settings.gitlab['default_can_create_group'] = true if Settings.gitlab['default_can_create_group'].nil?
Settings.gitlab['default_theme'] = Gitlab::Themes::APPLICATION_DEFAULT if Settings.gitlab['default_theme'].nil? Settings.gitlab['default_theme'] = Gitlab::Themes::APPLICATION_DEFAULT if Settings.gitlab['default_theme'].nil?
Settings.gitlab['host'] ||= ENV['GITLAB_HOST'] || 'localhost' Settings.gitlab['host'] ||= ENV['GITLAB_HOST'] || 'localhost'
Settings.gitlab['ssh_host'] ||= Settings.gitlab.host Settings.gitlab['ssh_host'] ||= Settings.gitlab.host
Settings.gitlab['https'] = false if Settings.gitlab['https'].nil? Settings.gitlab['https'] = false if Settings.gitlab['https'].nil?
Settings.gitlab['port'] ||= ENV['GITLAB_PORT'] || (Settings.gitlab.https ? 443 : 80) Settings.gitlab['port'] ||= ENV['GITLAB_PORT'] || (Settings.gitlab.https ? 443 : 80)
Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || '' Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
...@@ -176,10 +176,10 @@ Settings.gitlab['email_display_name'] ||= ENV['GITLAB_EMAIL_DISPLAY_NAME'] || 'G ...@@ -176,10 +176,10 @@ Settings.gitlab['email_display_name'] ||= ENV['GITLAB_EMAIL_DISPLAY_NAME'] || 'G
Settings.gitlab['email_reply_to'] ||= ENV['GITLAB_EMAIL_REPLY_TO'] || "noreply@#{Settings.gitlab.host}" Settings.gitlab['email_reply_to'] ||= ENV['GITLAB_EMAIL_REPLY_TO'] || "noreply@#{Settings.gitlab.host}"
Settings.gitlab['email_subject_suffix'] ||= ENV['GITLAB_EMAIL_SUBJECT_SUFFIX'] || "" Settings.gitlab['email_subject_suffix'] ||= ENV['GITLAB_EMAIL_SUBJECT_SUFFIX'] || ""
Settings.gitlab['email_smime'] = SmimeSignatureSettings.parse(Settings.gitlab['email_smime']) Settings.gitlab['email_smime'] = SmimeSignatureSettings.parse(Settings.gitlab['email_smime'])
Settings.gitlab['base_url'] ||= Settings.__send__(:build_base_gitlab_url) Settings.gitlab['base_url'] ||= Settings.__send__(:build_base_gitlab_url)
Settings.gitlab['url'] ||= Settings.__send__(:build_gitlab_url) Settings.gitlab['url'] ||= Settings.__send__(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git' Settings.gitlab['user'] ||= 'git'
Settings.gitlab['user_home'] ||= begin Settings.gitlab['user_home'] ||= begin
Etc.getpwnam(Settings.gitlab['user']).dir Etc.getpwnam(Settings.gitlab['user']).dir
rescue ArgumentError # no user configured rescue ArgumentError # no user configured
'/home/' + Settings.gitlab['user'] '/home/' + Settings.gitlab['user']
...@@ -257,13 +257,13 @@ Settings.artifacts['object_store'] = ObjectStoreSettings.parse(Settings.artifact ...@@ -257,13 +257,13 @@ Settings.artifacts['object_store'] = ObjectStoreSettings.parse(Settings.artifact
# Registry # Registry
# #
Settings['registry'] ||= Settingslogic.new({}) Settings['registry'] ||= Settingslogic.new({})
Settings.registry['enabled'] ||= false Settings.registry['enabled'] ||= false
Settings.registry['host'] ||= "example.com" Settings.registry['host'] ||= "example.com"
Settings.registry['port'] ||= nil Settings.registry['port'] ||= nil
Settings.registry['api_url'] ||= "http://localhost:5000/" Settings.registry['api_url'] ||= "http://localhost:5000/"
Settings.registry['key'] ||= nil Settings.registry['key'] ||= nil
Settings.registry['issuer'] ||= nil Settings.registry['issuer'] ||= nil
Settings.registry['host_port'] ||= [Settings.registry['host'], Settings.registry['port']].compact.join(':') Settings.registry['host_port'] ||= [Settings.registry['host'], Settings.registry['port']].compact.join(':')
Settings.registry['path'] = Settings.absolute(Settings.registry['path'] || File.join(Settings.shared['path'], 'registry')) Settings.registry['path'] = Settings.absolute(Settings.registry['path'] || File.join(Settings.shared['path'], 'registry'))
Settings.registry['notifications'] ||= [] Settings.registry['notifications'] ||= []
...@@ -284,13 +284,13 @@ Settings.pages['enabled'] = false if Settings.pages['enabled'].nil? ...@@ -284,13 +284,13 @@ Settings.pages['enabled'] = false if Settings.pages['enabled'].nil?
Settings.pages['access_control'] = false if Settings.pages['access_control'].nil? Settings.pages['access_control'] = false if Settings.pages['access_control'].nil?
Settings.pages['path'] = Settings.absolute(Settings.pages['path'] || File.join(Settings.shared['path'], "pages")) Settings.pages['path'] = Settings.absolute(Settings.pages['path'] || File.join(Settings.shared['path'], "pages"))
Settings.pages['https'] = false if Settings.pages['https'].nil? Settings.pages['https'] = false if Settings.pages['https'].nil?
Settings.pages['host'] ||= "example.com" Settings.pages['host'] ||= "example.com"
Settings.pages['port'] ||= Settings.pages.https ? 443 : 80 Settings.pages['port'] ||= Settings.pages.https ? 443 : 80
Settings.pages['protocol'] ||= Settings.pages.https ? "https" : "http" Settings.pages['protocol'] ||= Settings.pages.https ? "https" : "http"
Settings.pages['url'] ||= Settings.__send__(:build_pages_url) Settings.pages['url'] ||= Settings.__send__(:build_pages_url)
Settings.pages['external_http'] ||= false unless Settings.pages['external_http'].present? Settings.pages['external_http'] ||= false unless Settings.pages['external_http'].present?
Settings.pages['external_https'] ||= false unless Settings.pages['external_https'].present? Settings.pages['external_https'] ||= false unless Settings.pages['external_https'].present?
Settings.pages['artifacts_server'] ||= Settings.pages['enabled'] if Settings.pages['artifacts_server'].nil? Settings.pages['artifacts_server'] ||= Settings.pages['enabled'] if Settings.pages['artifacts_server'].nil?
Settings.pages['secret_file'] ||= Rails.root.join('.gitlab_pages_secret') Settings.pages['secret_file'] ||= Rails.root.join('.gitlab_pages_secret')
# #
...@@ -590,7 +590,7 @@ end ...@@ -590,7 +590,7 @@ end
# Backup # Backup
# #
Settings['backup'] ||= Settingslogic.new({}) Settings['backup'] ||= Settingslogic.new({})
Settings.backup['keep_time'] ||= 0 Settings.backup['keep_time'] ||= 0
Settings.backup['pg_schema'] = nil Settings.backup['pg_schema'] = nil
Settings.backup['path'] = Settings.absolute(Settings.backup['path'] || "tmp/backups/") Settings.backup['path'] = Settings.absolute(Settings.backup['path'] || "tmp/backups/")
Settings.backup['archive_permissions'] ||= 0600 Settings.backup['archive_permissions'] ||= 0600
......
...@@ -45,7 +45,6 @@ namespace :admin do ...@@ -45,7 +45,6 @@ namespace :admin do
scope(path: 'groups/*id', scope(path: 'groups/*id',
controller: :groups, controller: :groups,
constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ }) do constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ }) do
scope(as: :group) do scope(as: :group) do
put :members_update put :members_update
get :edit, action: :edit get :edit, action: :edit
...@@ -90,7 +89,6 @@ namespace :admin do ...@@ -90,7 +89,6 @@ namespace :admin do
path: '/', path: '/',
constraints: { id: Gitlab::PathRegex.project_route_regex }, constraints: { id: Gitlab::PathRegex.project_route_regex },
only: [:show, :destroy]) do only: [:show, :destroy]) do
member do member do
put :transfer put :transfer
post :repository_check post :repository_check
......
...@@ -29,7 +29,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -29,7 +29,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
constraints: { project_id: Gitlab::PathRegex.project_route_regex }, constraints: { project_id: Gitlab::PathRegex.project_route_regex },
module: :projects, module: :projects,
as: :project) do as: :project) do
# Begin of the /-/ scope. # Begin of the /-/ scope.
# Use this scope for all new project routes. # Use this scope for all new project routes.
scope '-' do scope '-' do
......
...@@ -15,7 +15,6 @@ class AdjournedGroupDeletionWorker ...@@ -15,7 +15,6 @@ class AdjournedGroupDeletionWorker
.with_deletion_schedule .with_deletion_schedule
.find_each(batch_size: 100) # rubocop: disable CodeReuse/ActiveRecord .find_each(batch_size: 100) # rubocop: disable CodeReuse/ActiveRecord
.with_index do |group, index| .with_index do |group, index|
deletion_schedule = group.deletion_schedule deletion_schedule = group.deletion_schedule
delay = index * INTERVAL delay = index * INTERVAL
......
...@@ -12,7 +12,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -12,7 +12,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
constraints: { project_id: Gitlab::PathRegex.project_route_regex }, constraints: { project_id: Gitlab::PathRegex.project_route_regex },
module: :projects, module: :projects,
as: :project) do as: :project) do
# Begin of the /-/ scope. # Begin of the /-/ scope.
# Use this scope for all new project routes. # Use this scope for all new project routes.
scope '-' do scope '-' do
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
describe RoutableActions do describe RoutableActions do
controller(::ApplicationController) do controller(::ApplicationController) do
include RoutableActions # rubocop:disable RSpec/DescribedClass include RoutableActions
before_action :routable before_action :routable
......
...@@ -67,8 +67,8 @@ describe Gitlab::Ci::Reports::LicenseScanning::License do ...@@ -67,8 +67,8 @@ describe Gitlab::Ci::Reports::LicenseScanning::License do
['LGPL-2.1', 'LGPL-2.1'], ['LGPL-2.1', 'LGPL-2.1'],
%w[MIT MIT], %w[MIT MIT],
['Mozilla Public License 2.0', 'MPL-2.0'], ['Mozilla Public License 2.0', 'MPL-2.0'],
['MS-PL', 'MS-PL'], %w[MS-PL MS-PL],
['MS-RL', 'MS-RL'], %w[MS-RL MS-RL],
['New BSD', 'BSD-3-Clause'], ['New BSD', 'BSD-3-Clause'],
['Python Software Foundation License', 'Python-2.0'], ['Python Software Foundation License', 'Python-2.0'],
%w[ruby Ruby], %w[ruby Ruby],
......
...@@ -342,13 +342,13 @@ describe "Git HTTP requests (Geo)", :geo do ...@@ -342,13 +342,13 @@ describe "Git HTTP requests (Geo)", :geo do
context 'when gl_id is provided via HTTP headers' do context 'when gl_id is provided via HTTP headers' do
context 'but is invalid' do context 'but is invalid' do
where(:geo_gl_id) do where(:geo_gl_id) do
[ %w[
'key-999', key-999
'key-1', key-1
'key-999', key-999
'junk', junk
'junk-1', junk-1
'kkey-1' kkey-1
] ]
end end
......
...@@ -15,11 +15,11 @@ describe Boards::ListService do ...@@ -15,11 +15,11 @@ describe Boards::ListService do
end end
it 'returns boards ordered by name' do it 'returns boards ordered by name' do
board_names = ['a-board', 'B-board', 'c-board'].shuffle board_names = %w[a-board B-board c-board].shuffle
boards.each_with_index { |board, i| board.update_column(:name, board_names[i]) } boards.each_with_index { |board, i| board.update_column(:name, board_names[i]) }
stub_licensed_features(multiple_group_issue_boards: true) stub_licensed_features(multiple_group_issue_boards: true)
expect(service.execute.pluck(:name)).to eq(['a-board', 'B-board', 'c-board']) expect(service.execute.pluck(:name)).to eq(%w[a-board B-board c-board])
end end
end end
end end
......
...@@ -558,7 +558,7 @@ describe EE::NotificationService, :mailer do ...@@ -558,7 +558,7 @@ describe EE::NotificationService, :mailer do
# User to be participant by default # User to be participant by default
# This user does not contain any record in notification settings table # This user does not contain any record in notification settings table
# It should be treated with a :participating notification_level # It should be treated with a :participating notification_level
@u_lazy_participant = create(:user, username: 'lazy-participant') @u_lazy_participant = create(:user, username: 'lazy-participant')
@u_guest_watcher = create_user_with_notification(:watch, 'guest_watching', group) @u_guest_watcher = create_user_with_notification(:watch, 'guest_watching', group)
@u_guest_custom = create_user_with_notification(:custom, 'guest_custom', group) @u_guest_custom = create_user_with_notification(:custom, 'guest_custom', group)
...@@ -700,7 +700,7 @@ describe EE::NotificationService, :mailer do ...@@ -700,7 +700,7 @@ describe EE::NotificationService, :mailer do
# User to be participant by default # User to be participant by default
# This user does not contain any record in notification settings table # This user does not contain any record in notification settings table
# It should be treated with a :participating notification_level # It should be treated with a :participating notification_level
@u_lazy_participant = create(:user, username: 'lazy-participant') @u_lazy_participant = create(:user, username: 'lazy-participant')
@u_guest_watcher = create_user_with_notification(:watch, 'guest_watching') @u_guest_watcher = create_user_with_notification(:watch, 'guest_watching')
@u_guest_custom = create_user_with_notification(:custom, 'guest_custom') @u_guest_custom = create_user_with_notification(:custom, 'guest_custom')
......
...@@ -27,7 +27,6 @@ module API ...@@ -27,7 +27,6 @@ module API
":id/#{awardable_string}/:#{awardable_id_string}/award_emoji", ":id/#{awardable_string}/:#{awardable_id_string}/award_emoji",
":id/#{awardable_string}/:#{awardable_id_string}/notes/:note_id/award_emoji" ":id/#{awardable_string}/:#{awardable_id_string}/notes/:note_id/award_emoji"
].each do |endpoint| ].each do |endpoint|
desc 'Get a list of project +awardable+ award emoji' do desc 'Get a list of project +awardable+ award emoji' do
detail 'This feature was introduced in 8.9' detail 'This feature was introduced in 8.9'
success Entities::AwardEmoji success Entities::AwardEmoji
......
...@@ -11,7 +11,6 @@ module Gitlab ...@@ -11,7 +11,6 @@ module Gitlab
# So we chose a way to use ::Ci::Build directly and we don't change the `archive!` method until 11.1 # So we chose a way to use ::Ci::Build directly and we don't change the `archive!` method until 11.1
::Ci::Build.finished.without_archived_trace ::Ci::Build.finished.without_archived_trace
.where(id: start_id..stop_id).find_each do |build| .where(id: start_id..stop_id).find_each do |build|
build.trace.archive! build.trace.archive!
rescue => e rescue => e
Rails.logger.error "Failed to archive live trace. id: #{build.id} message: #{e.message}" # rubocop:disable Gitlab/RailsLogger Rails.logger.error "Failed to archive live trace. id: #{build.id} message: #{e.message}" # rubocop:disable Gitlab/RailsLogger
......
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
def initialize(user:, shared:, project:) def initialize(user:, shared:, project:)
@path = File.join(shared.export_path, 'project.json') @path = File.join(shared.export_path, 'project.json')
@user = user @user = user
@shared = shared @shared = shared
@project = project @project = project
end end
......
...@@ -36,7 +36,7 @@ module Gitlab ...@@ -36,7 +36,7 @@ module Gitlab
end end
def relative_path(path) def relative_path(path)
path.gsub(%r{^#{Rails.root.to_s}/?}, '') path.gsub(%r{^#{Rails.root}/?}, '')
end end
def values_for(event) def values_for(event)
......
...@@ -18,7 +18,7 @@ module Gitlab ...@@ -18,7 +18,7 @@ module Gitlab
end end
def relative_path def relative_path
@relative_path ||= @file.gsub(%r{^#{Rails.root.to_s}/?}, '') @relative_path ||= @file.gsub(%r{^#{Rails.root}/?}, '')
end end
def to_param def to_param
......
...@@ -45,7 +45,7 @@ module Gitlab ...@@ -45,7 +45,7 @@ module Gitlab
require 'rblineprof' require 'rblineprof'
retval = nil retval = nil
samples = lineprof(/^#{Rails.root.to_s}/) { retval = yield } samples = lineprof(/^#{Rails.root}/) { retval = yield }
file_samples = aggregate_rblineprof(samples) file_samples = aggregate_rblineprof(samples)
......
...@@ -206,7 +206,6 @@ module Gitlab ...@@ -206,7 +206,6 @@ module Gitlab
.by_type(:JiraService) .by_type(:JiraService)
.includes(:jira_tracker_data) .includes(:jira_tracker_data)
.find_in_batches(batch_size: BATCH_SIZE) do |services| .find_in_batches(batch_size: BATCH_SIZE) do |services|
counts = services.group_by do |service| counts = services.group_by do |service|
# TODO: Simplify as part of https://gitlab.com/gitlab-org/gitlab/issues/29404 # TODO: Simplify as part of https://gitlab.com/gitlab-org/gitlab/issues/29404
service_url = service.data_fields&.url || (service.properties && service.properties['url']) service_url = service.data_fields&.url || (service.properties && service.properties['url'])
......
...@@ -9,7 +9,6 @@ namespace :gitlab do ...@@ -9,7 +9,6 @@ namespace :gitlab do
LfsObject.with_files_stored_locally LfsObject.with_files_stored_locally
.find_each(batch_size: 10) do |lfs_object| .find_each(batch_size: 10) do |lfs_object|
lfs_object.file.migrate!(LfsObjectUploader::Store::REMOTE) lfs_object.file.migrate!(LfsObjectUploader::Store::REMOTE)
logger.info("Transferred LFS object #{lfs_object.oid} of size #{lfs_object.size.to_i.bytes} to object storage") logger.info("Transferred LFS object #{lfs_object.oid} of size #{lfs_object.size.to_i.bytes} to object storage")
...@@ -24,7 +23,6 @@ namespace :gitlab do ...@@ -24,7 +23,6 @@ namespace :gitlab do
LfsObject.with_files_stored_remotely LfsObject.with_files_stored_remotely
.find_each(batch_size: 10) do |lfs_object| .find_each(batch_size: 10) do |lfs_object|
lfs_object.file.migrate!(LfsObjectUploader::Store::LOCAL) lfs_object.file.migrate!(LfsObjectUploader::Store::LOCAL)
logger.info("Transferred LFS object #{lfs_object.oid} of size #{lfs_object.size.to_i.bytes} to local storage") logger.info("Transferred LFS object #{lfs_object.oid} of size #{lfs_object.size.to_i.bytes} to local storage")
......
...@@ -153,7 +153,7 @@ module QA ...@@ -153,7 +153,7 @@ module QA
# The git cli produces the 'warning: redirecting to..' output # The git cli produces the 'warning: redirecting to..' output
# internally. # internally.
expect(push.output).to match(/warning: redirecting to #{absolute_path}/) expect(push.output).to match(/warning: redirecting to #{absolute_path}/)
expect(push.output).to match(/Locking support detected on remote "#{location.uri.to_s}"/) expect(push.output).to match(/Locking support detected on remote "#{location.uri}"/)
# Validate git push worked and new content is visible # Validate git push worked and new content is visible
Page::Project::Show.perform do |show| Page::Project::Show.perform do |show|
......
...@@ -168,7 +168,7 @@ module QA ...@@ -168,7 +168,7 @@ module QA
ssh_uri = project.repository_ssh_location.git_uri.to_s.gsub(%r{ssh://}, '') ssh_uri = project.repository_ssh_location.git_uri.to_s.gsub(%r{ssh://}, '')
expect(push.output).to match(%r{We'll help you by proxying this.*request to the primary:.*#{ssh_uri}}m) expect(push.output).to match(%r{We'll help you by proxying this.*request to the primary:.*#{ssh_uri}}m)
expect(push.output).to match(/Locking support detected on remote "#{location.uri.to_s}"/) expect(push.output).to match(/Locking support detected on remote "#{location.uri}"/)
# Validate git push worked and new content is visible # Validate git push worked and new content is visible
Page::Project::Show.perform do |show| Page::Project::Show.perform do |show|
......
...@@ -10,7 +10,7 @@ describe ConfirmEmailWarning do ...@@ -10,7 +10,7 @@ describe ConfirmEmailWarning do
controller(ApplicationController) do controller(ApplicationController) do
# `described_class` is not available in this context # `described_class` is not available in this context
include ConfirmEmailWarning # rubocop:disable RSpec/DescribedClass include ConfirmEmailWarning
def index def index
head :ok head :ok
......
...@@ -22,7 +22,7 @@ describe ControllerWithCrossProjectAccessCheck do ...@@ -22,7 +22,7 @@ describe ControllerWithCrossProjectAccessCheck do
describe '#requires_cross_project_access' do describe '#requires_cross_project_access' do
controller(ApplicationController) do controller(ApplicationController) do
# `described_class` is not available in this context # `described_class` is not available in this context
include ControllerWithCrossProjectAccessCheck # rubocop:disable RSpec/DescribedClass include ControllerWithCrossProjectAccessCheck
requires_cross_project_access :index, show: false, requires_cross_project_access :index, show: false,
unless: -> { unless_condition }, unless: -> { unless_condition },
...@@ -81,7 +81,7 @@ describe ControllerWithCrossProjectAccessCheck do ...@@ -81,7 +81,7 @@ describe ControllerWithCrossProjectAccessCheck do
describe '#skip_cross_project_access_check' do describe '#skip_cross_project_access_check' do
controller(ApplicationController) do controller(ApplicationController) do
# `described_class` is not available in this context # `described_class` is not available in this context
include ControllerWithCrossProjectAccessCheck # rubocop:disable RSpec/DescribedClass include ControllerWithCrossProjectAccessCheck
requires_cross_project_access requires_cross_project_access
......
...@@ -8,7 +8,7 @@ describe GroupTree do ...@@ -8,7 +8,7 @@ describe GroupTree do
controller(ApplicationController) do controller(ApplicationController) do
# `described_class` is not available in this context # `described_class` is not available in this context
include GroupTree # rubocop:disable RSpec/DescribedClass include GroupTree
def index def index
render_group_tree GroupsFinder.new(current_user).execute render_group_tree GroupsFinder.new(current_user).execute
......
...@@ -7,7 +7,7 @@ describe LfsRequest do ...@@ -7,7 +7,7 @@ describe LfsRequest do
controller(Projects::GitHttpClientController) do controller(Projects::GitHttpClientController) do
# `described_class` is not available in this context # `described_class` is not available in this context
include LfsRequest # rubocop:disable RSpec/DescribedClass include LfsRequest
def show def show
storage_project storage_project
......
...@@ -16,7 +16,7 @@ describe MetricsDashboard do ...@@ -16,7 +16,7 @@ describe MetricsDashboard do
end end
controller(::ApplicationController) do controller(::ApplicationController) do
include MetricsDashboard # rubocop:disable RSpec/DescribedClass include MetricsDashboard
end end
let(:json_response) do let(:json_response) do
......
...@@ -9,7 +9,7 @@ describe RendersCommits do ...@@ -9,7 +9,7 @@ describe RendersCommits do
controller(ApplicationController) do controller(ApplicationController) do
# `described_class` is not available in this context # `described_class` is not available in this context
include RendersCommits # rubocop:disable RSpec/DescribedClass include RendersCommits
def index def index
@merge_request = MergeRequest.find(params[:id]) @merge_request = MergeRequest.find(params[:id])
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
describe RoutableActions do describe RoutableActions do
controller(::ApplicationController) do controller(::ApplicationController) do
include RoutableActions # rubocop:disable RSpec/DescribedClass include RoutableActions
before_action :routable before_action :routable
......
...@@ -17,7 +17,7 @@ describe SourcegraphGon do ...@@ -17,7 +17,7 @@ describe SourcegraphGon do
let(:project) { internal_project } let(:project) { internal_project }
controller(ApplicationController) do controller(ApplicationController) do
include SourcegraphGon # rubocop:disable RSpec/DescribedClass include SourcegraphGon
def index def index
head :ok head :ok
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
describe StaticObjectExternalStorage do describe StaticObjectExternalStorage do
controller(Projects::ApplicationController) do controller(Projects::ApplicationController) do
include StaticObjectExternalStorage # rubocop:disable RSpec/DescribedClass include StaticObjectExternalStorage
before_action :redirect_to_external_storage, if: :static_objects_external_storage_enabled? before_action :redirect_to_external_storage, if: :static_objects_external_storage_enabled?
......
...@@ -591,7 +591,7 @@ describe Projects::BranchesController do ...@@ -591,7 +591,7 @@ describe Projects::BranchesController do
params: { params: {
namespace_id: project.namespace, namespace_id: project.namespace,
project_id: project, project_id: project,
names: ['fix', 'add-pdf-file', 'branch-merged'] names: %w[fix add-pdf-file branch-merged]
} }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
...@@ -639,7 +639,7 @@ describe Projects::BranchesController do ...@@ -639,7 +639,7 @@ describe Projects::BranchesController do
params: { params: {
namespace_id: project.namespace, namespace_id: project.namespace,
project_id: project, project_id: project,
names: ['fix', 'add-pdf-file', 'branch-merged'] names: %w[fix add-pdf-file branch-merged]
} }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(200)
......
...@@ -50,7 +50,7 @@ describe 'Projects > Snippets > Create Snippet', :js do ...@@ -50,7 +50,7 @@ describe 'Projects > Snippets > Create Snippet', :js do
wait_for_requests wait_for_requests
link = find('a.no-attachment-icon img[alt="banana_sample"]')['src'] link = find('a.no-attachment-icon img[alt="banana_sample"]')['src']
expect(link).to match(%r{/#{Regexp.escape(project.full_path) }/uploads/\h{32}/banana_sample\.gif\z}) expect(link).to match(%r{/#{Regexp.escape(project.full_path)}/uploads/\h{32}/banana_sample\.gif\z})
end end
it 'creates a snippet when all required fields are filled in after validation failing' do it 'creates a snippet when all required fields are filled in after validation failing' do
...@@ -72,7 +72,7 @@ describe 'Projects > Snippets > Create Snippet', :js do ...@@ -72,7 +72,7 @@ describe 'Projects > Snippets > Create Snippet', :js do
expect(page).to have_selector('strong') expect(page).to have_selector('strong')
end end
link = find('a.no-attachment-icon img[alt="banana_sample"]')['src'] link = find('a.no-attachment-icon img[alt="banana_sample"]')['src']
expect(link).to match(%r{/#{Regexp.escape(project.full_path) }/uploads/\h{32}/banana_sample\.gif\z}) expect(link).to match(%r{/#{Regexp.escape(project.full_path)}/uploads/\h{32}/banana_sample\.gif\z})
end end
end end
......
...@@ -66,7 +66,7 @@ describe BranchesFinder do ...@@ -66,7 +66,7 @@ describe BranchesFinder do
end end
it 'filters branches by provided names' do it 'filters branches by provided names' do
branches_finder = described_class.new(repository, { names: ['fix', 'csv', 'lfs', 'does-not-exist'] }) branches_finder = described_class.new(repository, { names: %w[fix csv lfs does-not-exist] })
result = branches_finder.execute result = branches_finder.execute
......
...@@ -219,7 +219,7 @@ describe TodosFinder do ...@@ -219,7 +219,7 @@ describe TodosFinder do
end end
it "sorts by priority" do it "sorts by priority" do
project_2 = create(:project) project_2 = create(:project)
label_1 = create(:label, title: 'label_1', project: project, priority: 1) label_1 = create(:label, title: 'label_1', project: project, priority: 1)
label_2 = create(:label, title: 'label_2', project: project, priority: 2) label_2 = create(:label, title: 'label_2', project: project, priority: 2)
......
...@@ -332,13 +332,13 @@ describe ProjectsHelper do ...@@ -332,13 +332,13 @@ describe ProjectsHelper do
end end
it 'returns image tag for member avatar' do it 'returns image tag for member avatar' do
expect(helper).to receive(:image_tag).with(expected, { width: 16, class: ["avatar", "avatar-inline", "s16"], alt: "", "data-src" => anything }) expect(helper).to receive(:image_tag).with(expected, { width: 16, class: %w[avatar avatar-inline s16], alt: "", "data-src" => anything })
helper.link_to_member_avatar(user) helper.link_to_member_avatar(user)
end end
it 'returns image tag with avatar class' do it 'returns image tag with avatar class' do
expect(helper).to receive(:image_tag).with(expected, { width: 16, class: ["avatar", "avatar-inline", "s16", "any-avatar-class"], alt: "", "data-src" => anything }) expect(helper).to receive(:image_tag).with(expected, { width: 16, class: %w[avatar avatar-inline s16 any-avatar-class], alt: "", "data-src" => anything })
helper.link_to_member_avatar(user, avatar_class: "any-avatar-class") helper.link_to_member_avatar(user, avatar_class: "any-avatar-class")
end end
......
...@@ -100,7 +100,7 @@ describe ExpandVariables do ...@@ -100,7 +100,7 @@ describe ExpandVariables do
end end
with_them do with_them do
subject { ExpandVariables.expand(value, variables) } # rubocop:disable RSpec/DescribedClass subject { ExpandVariables.expand(value, variables) }
it { is_expected.to eq(result) } it { is_expected.to eq(result) }
end end
......
...@@ -481,7 +481,6 @@ module Gitlab ...@@ -481,7 +481,6 @@ module Gitlab
['../sample.adoc', 'doc/sample.adoc', 'relative path to a file up one directory'], ['../sample.adoc', 'doc/sample.adoc', 'relative path to a file up one directory'],
['../../sample.adoc', 'sample.adoc', 'relative path for a file up multiple directories'] ['../../sample.adoc', 'sample.adoc', 'relative path for a file up multiple directories']
].each do |include_path_, file_path_, desc| ].each do |include_path_, file_path_, desc|
context "the file is specified by #{desc}" do context "the file is specified by #{desc}" do
let(:include_path) { include_path_ } let(:include_path) { include_path_ }
let(:file_path) { file_path_ } let(:file_path) { file_path_ }
......
...@@ -31,13 +31,13 @@ describe Gitlab::Ci::Config::Entry::Cache do ...@@ -31,13 +31,13 @@ describe Gitlab::Ci::Config::Entry::Cache do
it_behaves_like 'hash key value' it_behaves_like 'hash key value'
context 'with files' do context 'with files' do
let(:key) { { files: ['a-file', 'other-file'] } } let(:key) { { files: %w[a-file other-file] } }
it_behaves_like 'hash key value' it_behaves_like 'hash key value'
end end
context 'with files and prefix' do context 'with files and prefix' do
let(:key) { { files: ['a-file', 'other-file'], prefix: 'prefix-value' } } let(:key) { { files: %w[a-file other-file], prefix: 'prefix-value' } }
it_behaves_like 'hash key value' it_behaves_like 'hash key value'
end end
...@@ -55,7 +55,7 @@ describe Gitlab::Ci::Config::Entry::Cache do ...@@ -55,7 +55,7 @@ describe Gitlab::Ci::Config::Entry::Cache do
it { is_expected.to be_valid } it { is_expected.to be_valid }
context 'with files' do context 'with files' do
let(:key) { { files: ['a-file', 'other-file'] } } let(:key) { { files: %w[a-file other-file] } }
it { is_expected.to be_valid } it { is_expected.to be_valid }
end end
......
...@@ -6,12 +6,12 @@ shared_examples 'renames child namespaces' do |type| ...@@ -6,12 +6,12 @@ shared_examples 'renames child namespaces' do |type|
it 'renames namespaces' do it 'renames namespaces' do
rename_namespaces = double rename_namespaces = double
expect(described_class::RenameNamespaces) expect(described_class::RenameNamespaces)
.to receive(:new).with(['first-path', 'second-path'], subject) .to receive(:new).with(%w[first-path second-path], subject)
.and_return(rename_namespaces) .and_return(rename_namespaces)
expect(rename_namespaces).to receive(:rename_namespaces) expect(rename_namespaces).to receive(:rename_namespaces)
.with(type: :child) .with(type: :child)
subject.rename_wildcard_paths(['first-path', 'second-path']) subject.rename_wildcard_paths(%w[first-path second-path])
end end
end end
......
...@@ -54,7 +54,7 @@ describe Gitlab::Experimentation do ...@@ -54,7 +54,7 @@ describe Gitlab::Experimentation do
describe '#experiment_enabled?' do describe '#experiment_enabled?' do
context 'cookie is not present' do context 'cookie is not present' do
it 'calls Gitlab::Experimentation.enabled_for_user? with the name of the experiment and an experimentation_subject_index of nil' do it 'calls Gitlab::Experimentation.enabled_for_user? with the name of the experiment and an experimentation_subject_index of nil' do
expect(Gitlab::Experimentation).to receive(:enabled_for_user?).with(:test_experiment, nil) # rubocop:disable RSpec/DescribedClass expect(Gitlab::Experimentation).to receive(:enabled_for_user?).with(:test_experiment, nil)
controller.experiment_enabled?(:test_experiment) controller.experiment_enabled?(:test_experiment)
end end
end end
...@@ -67,7 +67,7 @@ describe Gitlab::Experimentation do ...@@ -67,7 +67,7 @@ describe Gitlab::Experimentation do
it 'calls Gitlab::Experimentation.enabled_for_user? with the name of the experiment and an experimentation_subject_index of the modulo 100 of the hex value of the uuid' do it 'calls Gitlab::Experimentation.enabled_for_user? with the name of the experiment and an experimentation_subject_index of the modulo 100 of the hex value of the uuid' do
# 'abcd1234'.hex % 100 = 76 # 'abcd1234'.hex % 100 = 76
expect(Gitlab::Experimentation).to receive(:enabled_for_user?).with(:test_experiment, 76) # rubocop:disable RSpec/DescribedClass expect(Gitlab::Experimentation).to receive(:enabled_for_user?).with(:test_experiment, 76)
controller.experiment_enabled?(:test_experiment) controller.experiment_enabled?(:test_experiment)
end end
end end
......
...@@ -12,7 +12,7 @@ describe Gitlab::GitalyClient::BlobService do ...@@ -12,7 +12,7 @@ describe Gitlab::GitalyClient::BlobService do
describe '#get_new_lfs_pointers' do describe '#get_new_lfs_pointers' do
let(:revision) { 'master' } let(:revision) { 'master' }
let(:limit) { 5 } let(:limit) { 5 }
let(:not_in) { ['branch-a', 'branch-b'] } let(:not_in) { %w[branch-a branch-b] }
let(:expected_params) do let(:expected_params) do
{ revision: revision, limit: limit, not_in_refs: not_in, not_in_all: false } { revision: revision, limit: limit, not_in_refs: not_in, not_in_all: false }
end end
......
...@@ -69,7 +69,7 @@ describe Gitlab::GitalyClient::RemoteService do ...@@ -69,7 +69,7 @@ describe Gitlab::GitalyClient::RemoteService do
describe '#update_remote_mirror' do describe '#update_remote_mirror' do
let(:ref_name) { 'remote_mirror_1' } let(:ref_name) { 'remote_mirror_1' }
let(:only_branches_matching) { ['my-branch', 'master'] } let(:only_branches_matching) { %w[my-branch master] }
let(:ssh_key) { 'KEY' } let(:ssh_key) { 'KEY' }
let(:known_hosts) { 'KNOWN HOSTS' } let(:known_hosts) { 'KNOWN HOSTS' }
......
...@@ -15,13 +15,13 @@ describe Gitlab::PhabricatorImport::Conduit::User do ...@@ -15,13 +15,13 @@ describe Gitlab::PhabricatorImport::Conduit::User do
it 'calls the api with the correct params' do it 'calls the api with the correct params' do
expected_params = { expected_params = {
constraints: { phids: ['phid-1', 'phid-2'] } constraints: { phids: %w[phid-1 phid-2] }
} }
expect(fake_client).to receive(:get).with('user.search', expect(fake_client).to receive(:get).with('user.search',
params: expected_params) params: expected_params)
user_client.users(['phid-1', 'phid-2']) user_client.users(%w[phid-1 phid-2])
end end
it 'returns an array of parsed responses' do it 'returns an array of parsed responses' do
...@@ -43,7 +43,7 @@ describe Gitlab::PhabricatorImport::Conduit::User do ...@@ -43,7 +43,7 @@ describe Gitlab::PhabricatorImport::Conduit::User do
expect(fake_client).to receive(:get).with('user.search', expect(fake_client).to receive(:get).with('user.search',
params: second_params).once params: second_params).once
user_client.users(['phid-1', 'phid-2']) user_client.users(%w[phid-1 phid-2])
end end
end end
end end
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
describe Gitlab::PhabricatorImport::UserFinder, :clean_gitlab_redis_cache do describe Gitlab::PhabricatorImport::UserFinder, :clean_gitlab_redis_cache do
let(:project) { create(:project, namespace: create(:group)) } let(:project) { create(:project, namespace: create(:group)) }
subject(:finder) { described_class.new(project, ['first-phid', 'second-phid']) } subject(:finder) { described_class.new(project, %w[first-phid second-phid]) }
before do before do
project.namespace.add_developer(existing_user) project.namespace.add_developer(existing_user)
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
describe Gitlab::QuickActions::Dsl do describe Gitlab::QuickActions::Dsl do
before :all do before :all do
DummyClass = Struct.new(:project) do DummyClass = Struct.new(:project) do
include Gitlab::QuickActions::Dsl # rubocop:disable RSpec/DescribedClass include Gitlab::QuickActions::Dsl
desc 'A command with no args' desc 'A command with no args'
command :no_args, :none do command :no_args, :none do
......
...@@ -110,7 +110,7 @@ RSpec.describe Quality::HelmClient do ...@@ -110,7 +110,7 @@ RSpec.describe Quality::HelmClient do
end end
context 'with multiple release names' do context 'with multiple release names' do
let(:release_name) { ['my-release', 'my-release-2'] } let(:release_name) { %w[my-release my-release-2] }
it 'raises an error if the Helm command fails' do it 'raises an error if the Helm command fails' do
expect(Gitlab::Popen).to receive(:popen_with_detail) expect(Gitlab::Popen).to receive(:popen_with_detail)
......
...@@ -46,7 +46,7 @@ RSpec.describe Quality::KubernetesClient do ...@@ -46,7 +46,7 @@ RSpec.describe Quality::KubernetesClient do
end end
context 'with multiple releases' do context 'with multiple releases' do
let(:release_name) { ['my-release', 'my-release-2'] } let(:release_name) { %w[my-release my-release-2] }
it 'raises an error if the Kubernetes command fails' do it 'raises an error if the Kubernetes command fails' do
expect(Gitlab::Popen).to receive(:popen_with_detail) expect(Gitlab::Popen).to receive(:popen_with_detail)
......
...@@ -139,7 +139,7 @@ RSpec.describe ActiveSession, :clean_gitlab_redis_shared_state do ...@@ -139,7 +139,7 @@ RSpec.describe ActiveSession, :clean_gitlab_redis_shared_state do
redis = double(:redis) redis = double(:redis)
expect(Gitlab::Redis::SharedState).to receive(:with).and_yield(redis) expect(Gitlab::Redis::SharedState).to receive(:with).and_yield(redis)
sessions = ['session-a', 'session-b'] sessions = %w[session-a session-b]
mget_responses = sessions.map { |session| [Marshal.dump(session)]} mget_responses = sessions.map { |session| [Marshal.dump(session)]}
expect(redis).to receive(:mget).twice.and_return(*mget_responses) expect(redis).to receive(:mget).twice.and_return(*mget_responses)
......
...@@ -384,7 +384,7 @@ describe MergeRequest do ...@@ -384,7 +384,7 @@ describe MergeRequest do
end end
it 'returns target branches sort by updated at desc' do it 'returns target branches sort by updated at desc' do
expect(described_class.recent_target_branches).to match_array(['feature', 'merge-test', 'fix']) expect(described_class.recent_target_branches).to match_array(%w[feature merge-test fix])
end end
end end
......
...@@ -115,7 +115,7 @@ describe API::Wikis do ...@@ -115,7 +115,7 @@ describe API::Wikis do
end end
[:title, :content, :format].each do |part| [:title, :content, :format].each do |part|
it "it updates with wiki with missing #{part}" do it "updates with wiki with missing #{part}" do
payload.delete(part) payload.delete(part)
put(api(url, user), params: payload) put(api(url, user), params: payload)
......
...@@ -2707,7 +2707,7 @@ describe NotificationService, :mailer do ...@@ -2707,7 +2707,7 @@ describe NotificationService, :mailer do
# User to be participant by default # User to be participant by default
# This user does not contain any record in notification settings table # This user does not contain any record in notification settings table
# It should be treated with a :participating notification_level # It should be treated with a :participating notification_level
@u_lazy_participant = create(:user, username: 'lazy-participant') @u_lazy_participant = create(:user, username: 'lazy-participant')
@u_guest_watcher = create_user_with_notification(:watch, 'guest_watching') @u_guest_watcher = create_user_with_notification(:watch, 'guest_watching')
@u_guest_custom = create_user_with_notification(:custom, 'guest_custom') @u_guest_custom = create_user_with_notification(:custom, 'guest_custom')
......
...@@ -297,11 +297,11 @@ shared_examples 'thread comments' do |resource_name| ...@@ -297,11 +297,11 @@ shared_examples 'thread comments' do |resource_name|
find("#{form_selector} .note-textarea").send_keys('a') find("#{form_selector} .note-textarea").send_keys('a')
end end
it "should show a 'Comment & reopen #{resource_name}' button" do it "shows a 'Comment & reopen #{resource_name}' button" do
expect(find("#{form_selector} .js-note-target-reopen")).to have_content "Comment & reopen #{resource_name}" expect(find("#{form_selector} .js-note-target-reopen")).to have_content "Comment & reopen #{resource_name}"
end end
it "should show a 'Start thread & reopen #{resource_name}' button when 'Start thread' is selected" do it "shows a 'Start thread & reopen #{resource_name}' button when 'Start thread' is selected" do
find(toggle_selector).click find(toggle_selector).click
find("#{menu_selector} li", match: :first) find("#{menu_selector} li", match: :first)
......
...@@ -154,7 +154,6 @@ module TestEnv ...@@ -154,7 +154,6 @@ module TestEnv
install_dir: gitaly_dir, install_dir: gitaly_dir,
version: Gitlab::GitalyClient.expected_server_version, version: Gitlab::GitalyClient.expected_server_version,
task: "gitlab:gitaly:install[#{install_gitaly_args}]") do task: "gitlab:gitaly:install[#{install_gitaly_args}]") do
Gitlab::SetupHelper.create_gitaly_configuration(gitaly_dir, { 'default' => repos_path }, force: true) Gitlab::SetupHelper.create_gitaly_configuration(gitaly_dir, { 'default' => repos_path }, force: true)
start_gitaly(gitaly_dir) start_gitaly(gitaly_dir)
end end
......
...@@ -11,7 +11,7 @@ describe 'projects/commit/branches.html.haml' do ...@@ -11,7 +11,7 @@ describe 'projects/commit/branches.html.haml' do
context 'when branches and tags are available' do context 'when branches and tags are available' do
before do before do
assign(:branches, ['master', 'test-branch']) assign(:branches, %w[master test-branch])
assign(:branches_limit_exceeded, false) assign(:branches_limit_exceeded, false)
assign(:tags, ['tag1']) assign(:tags, ['tag1'])
assign(:tags_limit_exceeded, false) assign(:tags_limit_exceeded, false)
...@@ -35,7 +35,7 @@ describe 'projects/commit/branches.html.haml' do ...@@ -35,7 +35,7 @@ describe 'projects/commit/branches.html.haml' do
context 'when branches are available but no tags' do context 'when branches are available but no tags' do
before do before do
assign(:branches, ['master', 'test-branch']) assign(:branches, %w[master test-branch])
assign(:branches_limit_exceeded, false) assign(:branches_limit_exceeded, false)
assign(:tags, []) assign(:tags, [])
assign(:tags_limit_exceeded, true) assign(:tags_limit_exceeded, true)
......
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