Commit 7a7403b7 authored by Ryan Cobb's avatar Ryan Cobb

Updates gitlab-styles gem to 3.1.0

This updates gitlab-styles to 3.1.0 and disables any new cops introduced
in this upgrade. These new cops will be re-enabled in subsequent
changes. This also disables the existing RSpec/DescribedClass cop as
this upgrade has caused it to break specs.
parent 7e3680dd
......@@ -299,3 +299,76 @@ Graphql/Descriptions:
RSpec/AnyInstanceOf:
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
gem 'spring', '~> 2.0.0'
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
gem 'rubocop', '~> 0.69.0'
gem 'rubocop-performance', '~> 1.1.0'
gem 'rubocop-rspec', '~> 1.22.1'
gem 'rubocop', '~> 0.74.0'
gem 'rubocop-performance', '~> 1.4.1'
gem 'rubocop-rspec', '~> 1.37.0'
gem 'scss_lint', '~> 0.56.0', require: false
gem 'haml_lint', '~> 0.34.0', require: false
......
......@@ -379,11 +379,12 @@ GEM
gitlab-puma (>= 2.7, < 5)
gitlab-sidekiq-fetcher (0.5.2)
sidekiq (~> 5)
gitlab-styles (2.8.0)
rubocop (~> 0.69.0)
gitlab-styles (3.1.0)
rubocop (~> 0.74.0)
rubocop-gitlab-security (~> 0.1.0)
rubocop-performance (~> 1.1.0)
rubocop-rspec (~> 1.19)
rubocop-performance (~> 1.4.1)
rubocop-rails (~> 2.0)
rubocop-rspec (~> 1.36)
gitlab_chronic_duration (0.10.6.2)
numerizer (~> 0.2)
gitlab_omniauth-ldap (2.1.1)
......@@ -519,7 +520,7 @@ GEM
jaeger-client (0.10.0)
opentracing (~> 0.3)
thrift
jaro_winkler (1.5.3)
jaro_winkler (1.5.4)
jira-ruby (1.7.1)
activesupport
atlassian-jwt
......@@ -726,8 +727,8 @@ GEM
rubypants (~> 0.2)
orm_adapter (0.5.0)
os (1.0.0)
parallel (1.17.0)
parser (2.6.3.0)
parallel (1.19.1)
parser (2.6.5.0)
ast (~> 2.4.0)
parslet (1.8.2)
peek (1.1.0)
......@@ -904,7 +905,7 @@ GEM
pg
rails
sqlite3
rubocop (0.69.0)
rubocop (0.74.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
......@@ -913,10 +914,13 @@ GEM
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-gitlab-security (0.1.1)
rubocop (>= 0.51)
rubocop-performance (1.1.0)
rubocop (>= 0.67.0)
rubocop-rspec (1.22.2)
rubocop (>= 0.52.1)
rubocop-performance (1.4.1)
rubocop (>= 0.71.0)
rubocop-rails (2.4.0)
rack (>= 1.1)
rubocop (>= 0.72.0)
rubocop-rspec (1.37.0)
rubocop (>= 0.68.1)
ruby-enum (0.7.2)
i18n
ruby-fogbugz (0.2.1)
......@@ -1207,7 +1211,7 @@ DEPENDENCIES
gitlab-puma (~> 4.3.1.gitlab.2)
gitlab-puma_worker_killer (~> 0.1.1.gitlab.1)
gitlab-sidekiq-fetcher (= 0.5.2)
gitlab-styles (~> 2.7)
gitlab-styles (~> 3.1.0)
gitlab_chronic_duration (~> 0.10.6.2)
gitlab_omniauth-ldap (~> 2.1.1)
gon (~> 6.2)
......@@ -1318,9 +1322,9 @@ DEPENDENCIES
rspec-set (~> 0.1.3)
rspec_junit_formatter
rspec_profiling (~> 0.0.5)
rubocop (~> 0.69.0)
rubocop-performance (~> 1.1.0)
rubocop-rspec (~> 1.22.1)
rubocop (~> 0.74.0)
rubocop-performance (~> 1.4.1)
rubocop-rspec (~> 1.37.0)
ruby-fogbugz (~> 0.2.1)
ruby-prof (~> 1.0.0)
ruby-progressbar
......
# frozen_string_literal: true
class Admin::SystemInfoController < Admin::ApplicationController
EXCLUDED_MOUNT_OPTIONS = [
'nobrowse',
'read-only',
'ro'
EXCLUDED_MOUNT_OPTIONS = %w[
nobrowse
read-only
ro
].freeze
EXCLUDED_MOUNT_TYPES = [
......
......@@ -35,7 +35,7 @@ module DashboardHelper
tag.p(aria: { label: label }) do
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)
end)
......
......@@ -127,7 +127,7 @@ module SnippetsHelper
return unless attrs = snippet_badge_attributes(snippet)
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(' ')
concat(text)
......
......@@ -234,7 +234,7 @@ module Gitlab
credentials: true,
headers: :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
# Cross-origin requests must not have the session cookie available
......@@ -244,7 +244,7 @@ module Gitlab
credentials: false,
headers: :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
......
......@@ -45,7 +45,6 @@ namespace :admin do
scope(path: 'groups/*id',
controller: :groups,
constraints: { id: Gitlab::PathRegex.full_namespace_route_regex, format: /(html|json|atom)/ }) do
scope(as: :group) do
put :members_update
get :edit, action: :edit
......@@ -90,7 +89,6 @@ namespace :admin do
path: '/',
constraints: { id: Gitlab::PathRegex.project_route_regex },
only: [:show, :destroy]) do
member do
put :transfer
post :repository_check
......
......@@ -29,7 +29,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
constraints: { project_id: Gitlab::PathRegex.project_route_regex },
module: :projects,
as: :project) do
# Begin of the /-/ scope.
# Use this scope for all new project routes.
scope '-' do
......
......@@ -15,7 +15,6 @@ class AdjournedGroupDeletionWorker
.with_deletion_schedule
.find_each(batch_size: 100) # rubocop: disable CodeReuse/ActiveRecord
.with_index do |group, index|
deletion_schedule = group.deletion_schedule
delay = index * INTERVAL
......
......@@ -12,7 +12,6 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
constraints: { project_id: Gitlab::PathRegex.project_route_regex },
module: :projects,
as: :project) do
# Begin of the /-/ scope.
# Use this scope for all new project routes.
scope '-' do
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
describe RoutableActions do
controller(::ApplicationController) do
include RoutableActions # rubocop:disable RSpec/DescribedClass
include RoutableActions
before_action :routable
......
......@@ -67,8 +67,8 @@ describe Gitlab::Ci::Reports::LicenseScanning::License do
['LGPL-2.1', 'LGPL-2.1'],
%w[MIT MIT],
['Mozilla Public License 2.0', 'MPL-2.0'],
['MS-PL', 'MS-PL'],
['MS-RL', 'MS-RL'],
%w[MS-PL MS-PL],
%w[MS-RL MS-RL],
['New BSD', 'BSD-3-Clause'],
['Python Software Foundation License', 'Python-2.0'],
%w[ruby Ruby],
......
......@@ -342,13 +342,13 @@ describe "Git HTTP requests (Geo)", :geo do
context 'when gl_id is provided via HTTP headers' do
context 'but is invalid' do
where(:geo_gl_id) do
[
'key-999',
'key-1',
'key-999',
'junk',
'junk-1',
'kkey-1'
%w[
key-999
key-1
key-999
junk
junk-1
kkey-1
]
end
......
......@@ -15,11 +15,11 @@ describe Boards::ListService do
end
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]) }
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
......
......@@ -27,7 +27,6 @@ module API
":id/#{awardable_string}/:#{awardable_id_string}/award_emoji",
":id/#{awardable_string}/:#{awardable_id_string}/notes/:note_id/award_emoji"
].each do |endpoint|
desc 'Get a list of project +awardable+ award emoji' do
detail 'This feature was introduced in 8.9'
success Entities::AwardEmoji
......
......@@ -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
::Ci::Build.finished.without_archived_trace
.where(id: start_id..stop_id).find_each do |build|
build.trace.archive!
rescue => e
Rails.logger.error "Failed to archive live trace. id: #{build.id} message: #{e.message}" # rubocop:disable Gitlab/RailsLogger
......
......@@ -36,7 +36,7 @@ module Gitlab
end
def relative_path(path)
path.gsub(%r{^#{Rails.root.to_s}/?}, '')
path.gsub(%r{^#{Rails.root}/?}, '')
end
def values_for(event)
......
......@@ -18,7 +18,7 @@ module Gitlab
end
def relative_path
@relative_path ||= @file.gsub(%r{^#{Rails.root.to_s}/?}, '')
@relative_path ||= @file.gsub(%r{^#{Rails.root}/?}, '')
end
def to_param
......
......@@ -45,7 +45,7 @@ module Gitlab
require 'rblineprof'
retval = nil
samples = lineprof(/^#{Rails.root.to_s}/) { retval = yield }
samples = lineprof(/^#{Rails.root}/) { retval = yield }
file_samples = aggregate_rblineprof(samples)
......
......@@ -206,7 +206,6 @@ module Gitlab
.by_type(:JiraService)
.includes(:jira_tracker_data)
.find_in_batches(batch_size: BATCH_SIZE) do |services|
counts = services.group_by do |service|
# TODO: Simplify as part of https://gitlab.com/gitlab-org/gitlab/issues/29404
service_url = service.data_fields&.url || (service.properties && service.properties['url'])
......
......@@ -9,7 +9,6 @@ namespace :gitlab do
LfsObject.with_files_stored_locally
.find_each(batch_size: 10) do |lfs_object|
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")
......@@ -24,7 +23,6 @@ namespace :gitlab do
LfsObject.with_files_stored_remotely
.find_each(batch_size: 10) do |lfs_object|
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")
......
......@@ -153,7 +153,7 @@ module QA
# The git cli produces the 'warning: redirecting to..' output
# internally.
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
Page::Project::Show.perform do |show|
......
......@@ -168,7 +168,7 @@ module QA
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(/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
Page::Project::Show.perform do |show|
......
......@@ -10,7 +10,7 @@ describe ConfirmEmailWarning do
controller(ApplicationController) do
# `described_class` is not available in this context
include ConfirmEmailWarning # rubocop:disable RSpec/DescribedClass
include ConfirmEmailWarning
def index
head :ok
......
......@@ -22,7 +22,7 @@ describe ControllerWithCrossProjectAccessCheck do
describe '#requires_cross_project_access' do
controller(ApplicationController) do
# `described_class` is not available in this context
include ControllerWithCrossProjectAccessCheck # rubocop:disable RSpec/DescribedClass
include ControllerWithCrossProjectAccessCheck
requires_cross_project_access :index, show: false,
unless: -> { unless_condition },
......@@ -81,7 +81,7 @@ describe ControllerWithCrossProjectAccessCheck do
describe '#skip_cross_project_access_check' do
controller(ApplicationController) do
# `described_class` is not available in this context
include ControllerWithCrossProjectAccessCheck # rubocop:disable RSpec/DescribedClass
include ControllerWithCrossProjectAccessCheck
requires_cross_project_access
......
......@@ -8,7 +8,7 @@ describe GroupTree do
controller(ApplicationController) do
# `described_class` is not available in this context
include GroupTree # rubocop:disable RSpec/DescribedClass
include GroupTree
def index
render_group_tree GroupsFinder.new(current_user).execute
......
......@@ -7,7 +7,7 @@ describe LfsRequest do
controller(Projects::GitHttpClientController) do
# `described_class` is not available in this context
include LfsRequest # rubocop:disable RSpec/DescribedClass
include LfsRequest
def show
storage_project
......
......@@ -16,7 +16,7 @@ describe MetricsDashboard do
end
controller(::ApplicationController) do
include MetricsDashboard # rubocop:disable RSpec/DescribedClass
include MetricsDashboard
end
let(:json_response) do
......
......@@ -9,7 +9,7 @@ describe RendersCommits do
controller(ApplicationController) do
# `described_class` is not available in this context
include RendersCommits # rubocop:disable RSpec/DescribedClass
include RendersCommits
def index
@merge_request = MergeRequest.find(params[:id])
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
describe RoutableActions do
controller(::ApplicationController) do
include RoutableActions # rubocop:disable RSpec/DescribedClass
include RoutableActions
before_action :routable
......
......@@ -17,7 +17,7 @@ describe SourcegraphGon do
let(:project) { internal_project }
controller(ApplicationController) do
include SourcegraphGon # rubocop:disable RSpec/DescribedClass
include SourcegraphGon
def index
head :ok
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
describe StaticObjectExternalStorage 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?
......
......@@ -591,7 +591,7 @@ describe Projects::BranchesController do
params: {
namespace_id: project.namespace,
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)
......@@ -639,7 +639,7 @@ describe Projects::BranchesController do
params: {
namespace_id: project.namespace,
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)
......
......@@ -50,7 +50,7 @@ describe 'Projects > Snippets > Create Snippet', :js do
wait_for_requests
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
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
expect(page).to have_selector('strong')
end
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
......
......@@ -66,7 +66,7 @@ describe BranchesFinder do
end
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
......
......@@ -332,13 +332,13 @@ describe ProjectsHelper do
end
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)
end
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")
end
......
......@@ -100,7 +100,7 @@ describe ExpandVariables do
end
with_them do
subject { ExpandVariables.expand(value, variables) } # rubocop:disable RSpec/DescribedClass
subject { ExpandVariables.expand(value, variables) }
it { is_expected.to eq(result) }
end
......
......@@ -481,7 +481,6 @@ module Gitlab
['../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']
].each do |include_path_, file_path_, desc|
context "the file is specified by #{desc}" do
let(:include_path) { include_path_ }
let(:file_path) { file_path_ }
......
......@@ -31,13 +31,13 @@ describe Gitlab::Ci::Config::Entry::Cache do
it_behaves_like 'hash key value'
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'
end
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'
end
......@@ -55,7 +55,7 @@ describe Gitlab::Ci::Config::Entry::Cache do
it { is_expected.to be_valid }
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 }
end
......
......@@ -6,12 +6,12 @@ shared_examples 'renames child namespaces' do |type|
it 'renames namespaces' do
rename_namespaces = double
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)
expect(rename_namespaces).to receive(:rename_namespaces)
.with(type: :child)
subject.rename_wildcard_paths(['first-path', 'second-path'])
subject.rename_wildcard_paths(%w[first-path second-path])
end
end
......
......@@ -54,7 +54,7 @@ describe Gitlab::Experimentation do
describe '#experiment_enabled?' 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
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)
end
end
......@@ -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
# '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)
end
end
......
......@@ -12,7 +12,7 @@ describe Gitlab::GitalyClient::BlobService do
describe '#get_new_lfs_pointers' do
let(:revision) { 'master' }
let(:limit) { 5 }
let(:not_in) { ['branch-a', 'branch-b'] }
let(:not_in) { %w[branch-a branch-b] }
let(:expected_params) do
{ revision: revision, limit: limit, not_in_refs: not_in, not_in_all: false }
end
......
......@@ -69,7 +69,7 @@ describe Gitlab::GitalyClient::RemoteService do
describe '#update_remote_mirror' do
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(:known_hosts) { 'KNOWN HOSTS' }
......
......@@ -15,13 +15,13 @@ describe Gitlab::PhabricatorImport::Conduit::User do
it 'calls the api with the correct params' do
expected_params = {
constraints: { phids: ['phid-1', 'phid-2'] }
constraints: { phids: %w[phid-1 phid-2] }
}
expect(fake_client).to receive(:get).with('user.search',
params: expected_params)
user_client.users(['phid-1', 'phid-2'])
user_client.users(%w[phid-1 phid-2])
end
it 'returns an array of parsed responses' do
......@@ -43,7 +43,7 @@ describe Gitlab::PhabricatorImport::Conduit::User do
expect(fake_client).to receive(:get).with('user.search',
params: second_params).once
user_client.users(['phid-1', 'phid-2'])
user_client.users(%w[phid-1 phid-2])
end
end
end
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Gitlab::PhabricatorImport::UserFinder, :clean_gitlab_redis_cache do
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
project.namespace.add_developer(existing_user)
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Gitlab::QuickActions::Dsl do
before :all do
DummyClass = Struct.new(:project) do
include Gitlab::QuickActions::Dsl # rubocop:disable RSpec/DescribedClass
include Gitlab::QuickActions::Dsl
desc 'A command with no args'
command :no_args, :none do
......
......@@ -110,7 +110,7 @@ RSpec.describe Quality::HelmClient do
end
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
expect(Gitlab::Popen).to receive(:popen_with_detail)
......
......@@ -46,7 +46,7 @@ RSpec.describe Quality::KubernetesClient do
end
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
expect(Gitlab::Popen).to receive(:popen_with_detail)
......
......@@ -139,7 +139,7 @@ RSpec.describe ActiveSession, :clean_gitlab_redis_shared_state do
redis = double(: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)]}
expect(redis).to receive(:mget).twice.and_return(*mget_responses)
......
......@@ -384,7 +384,7 @@ describe MergeRequest do
end
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
......
......@@ -115,7 +115,7 @@ describe API::Wikis do
end
[: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)
put(api(url, user), params: payload)
......
......@@ -297,11 +297,11 @@ shared_examples 'thread comments' do |resource_name|
find("#{form_selector} .note-textarea").send_keys('a')
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}"
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("#{menu_selector} li", match: :first)
......
......@@ -154,7 +154,6 @@ module TestEnv
install_dir: gitaly_dir,
version: Gitlab::GitalyClient.expected_server_version,
task: "gitlab:gitaly:install[#{install_gitaly_args}]") do
Gitlab::SetupHelper.create_gitaly_configuration(gitaly_dir, { 'default' => repos_path }, force: true)
start_gitaly(gitaly_dir)
end
......
......@@ -11,7 +11,7 @@ describe 'projects/commit/branches.html.haml' do
context 'when branches and tags are available' do
before do
assign(:branches, ['master', 'test-branch'])
assign(:branches, %w[master test-branch])
assign(:branches_limit_exceeded, false)
assign(:tags, ['tag1'])
assign(:tags_limit_exceeded, false)
......@@ -35,7 +35,7 @@ describe 'projects/commit/branches.html.haml' do
context 'when branches are available but no tags' do
before do
assign(:branches, ['master', 'test-branch'])
assign(:branches, %w[master test-branch])
assign(:branches_limit_exceeded, false)
assign(:tags, [])
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