diff options
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/alert_management/alerts_finder_spec.rb | 4 | ||||
-rw-r--r-- | spec/finders/branches_finder_spec.rb | 14 | ||||
-rw-r--r-- | spec/finders/ci/runners_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/environments/environments_finder_spec.rb | 4 | ||||
-rw-r--r-- | spec/finders/groups_finder_spec.rb | 48 | ||||
-rw-r--r-- | spec/finders/license_template_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/merge_requests_finder_spec.rb | 6 | ||||
-rw-r--r-- | spec/finders/tags_finder_spec.rb | 12 | ||||
-rw-r--r-- | spec/finders/template_finder_spec.rb | 4 |
9 files changed, 48 insertions, 48 deletions
diff --git a/spec/finders/alert_management/alerts_finder_spec.rb b/spec/finders/alert_management/alerts_finder_spec.rb index 3c37d52d6c3..4d0324b9f1a 100644 --- a/spec/finders/alert_management/alerts_finder_spec.rb +++ b/spec/finders/alert_management/alerts_finder_spec.rb @@ -183,7 +183,7 @@ RSpec.describe AlertManagement::AlertsFinder, '#execute' do let(:params) { { sort: 'severity_asc' } } it 'sorts alerts by severity from less critical to more critical' do - expect(execute.pluck(:severity).uniq).to eq(%w(unknown info low medium high critical)) + expect(execute.pluck(:severity).uniq).to eq(%w[unknown info low medium high critical]) end end @@ -191,7 +191,7 @@ RSpec.describe AlertManagement::AlertsFinder, '#execute' do let(:params) { { sort: 'severity_desc' } } it 'sorts alerts by severity from more critical to less critical' do - expect(execute.pluck(:severity).uniq).to eq(%w(critical high medium low info unknown)) + expect(execute.pluck(:severity).uniq).to eq(%w[critical high medium low info unknown]) end end end diff --git a/spec/finders/branches_finder_spec.rb b/spec/finders/branches_finder_spec.rb index 9f185c8b8fb..004629eda95 100644 --- a/spec/finders/branches_finder_spec.rb +++ b/spec/finders/branches_finder_spec.rb @@ -92,7 +92,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do result = subject expect(result.count).to eq(3) - expect(result.map(&:name)).to eq(%w{csv fix lfs}) + expect(result.map(&:name)).to eq(%w[csv fix lfs]) end end @@ -265,7 +265,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(feature_conflict few-commits)) + expect(result.map(&:name)).to eq(%w[feature_conflict few-commits]) end end @@ -275,7 +275,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(fix flatten-dir)) + expect(result.map(&:name)).to eq(%w[fix flatten-dir]) end end @@ -306,7 +306,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(feature improve/awesome merge-test markdown feature_conflict)) + expect(result.map(&:name)).to eq(%w[feature improve/awesome merge-test markdown feature_conflict]) end end @@ -316,7 +316,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(merge-test markdown)) + expect(result.map(&:name)).to eq(%w[merge-test markdown]) end end end @@ -328,7 +328,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do result = subject expect(result.count).to eq(3) - expect(result.map(&:name)).to eq(%w{csv fix lfs}) + expect(result.map(&:name)).to eq(%w[csv fix lfs]) end end @@ -338,7 +338,7 @@ RSpec.describe BranchesFinder, feature_category: :source_code_management do it 'falls back to default execute and ignore paginations' do result = subject - expect(result.map(&:name)).to eq(%w(feature feature_conflict few-commits fix flatten-dir)) + expect(result.map(&:name)).to eq(%w[feature feature_conflict few-commits fix flatten-dir]) end end end diff --git a/spec/finders/ci/runners_finder_spec.rb b/spec/finders/ci/runners_finder_spec.rb index 5d249ddb391..06cca035c6f 100644 --- a/spec/finders/ci/runners_finder_spec.rb +++ b/spec/finders/ci/runners_finder_spec.rb @@ -171,7 +171,7 @@ RSpec.describe Ci::RunnersFinder, feature_category: :runner_fleet do it_behaves_like 'sorts by created_at descending' end - %w(created_date created_at_desc).each do |sort| + %w[created_date created_at_desc].each do |sort| context "with sort param equal to #{sort}" do let(:params) { { sort: sort } } diff --git a/spec/finders/environments/environments_finder_spec.rb b/spec/finders/environments/environments_finder_spec.rb index df66bbdc235..e3b1a121497 100644 --- a/spec/finders/environments/environments_finder_spec.rb +++ b/spec/finders/environments/environments_finder_spec.rb @@ -24,13 +24,13 @@ RSpec.describe Environments::EnvironmentsFinder do end it 'returns environments with any of the requested states' do - result = described_class.new(project, user, states: %w(available stopped)).execute + result = described_class.new(project, user, states: %w[available stopped]).execute expect(result).to contain_exactly(environment, environment_stopped, environment_available, stopped_environment) end it 'raises exception when requested state is invalid' do - expect { described_class.new(project, user, states: %w(invalid stopped)).execute }.to( + expect { described_class.new(project, user, states: %w[invalid stopped]).execute }.to( raise_error(described_class::InvalidStatesError, 'Requested states are invalid') ) end diff --git a/spec/finders/groups_finder_spec.rb b/spec/finders/groups_finder_spec.rb index 23d73b48199..f20c03c9658 100644 --- a/spec/finders/groups_finder_spec.rb +++ b/spec/finders/groups_finder_spec.rb @@ -12,30 +12,30 @@ RSpec.describe GroupsFinder, feature_category: :groups_and_projects do using RSpec::Parameterized::TableSyntax where(:user_type, :params, :results) do - nil | { all_available: true } | %i(public_group user_public_group) - nil | { all_available: false } | %i(public_group user_public_group) - nil | {} | %i(public_group user_public_group) - - :regular | { all_available: true } | %i(public_group internal_group user_public_group user_internal_group - user_private_group) - :regular | { all_available: false } | %i(user_public_group user_internal_group user_private_group) - :regular | {} | %i(public_group internal_group user_public_group user_internal_group user_private_group) - :regular | { min_access_level: Gitlab::Access::DEVELOPER } | %i(user_public_group user_internal_group user_private_group) - - :external | { all_available: true } | %i(public_group user_public_group user_internal_group user_private_group) - :external | { all_available: false } | %i(user_public_group user_internal_group user_private_group) - :external | {} | %i(public_group user_public_group user_internal_group user_private_group) - - :admin_without_admin_mode | { all_available: true } | %i(public_group internal_group user_public_group - user_internal_group user_private_group) - :admin_without_admin_mode | { all_available: false } | %i(user_public_group user_internal_group user_private_group) - :admin_without_admin_mode | {} | %i(public_group internal_group user_public_group user_internal_group user_private_group) - - :admin_with_admin_mode | { all_available: true } | %i(public_group internal_group private_group user_public_group - user_internal_group user_private_group) - :admin_with_admin_mode | { all_available: false } | %i(user_public_group user_internal_group user_private_group) - :admin_with_admin_mode | {} | %i(public_group internal_group private_group user_public_group user_internal_group - user_private_group) + nil | { all_available: true } | %i[public_group user_public_group] + nil | { all_available: false } | %i[public_group user_public_group] + nil | {} | %i[public_group user_public_group] + + :regular | { all_available: true } | %i[public_group internal_group user_public_group user_internal_group + user_private_group] + :regular | { all_available: false } | %i[user_public_group user_internal_group user_private_group] + :regular | {} | %i[public_group internal_group user_public_group user_internal_group user_private_group] + :regular | { min_access_level: Gitlab::Access::DEVELOPER } | %i[user_public_group user_internal_group user_private_group] + + :external | { all_available: true } | %i[public_group user_public_group user_internal_group user_private_group] + :external | { all_available: false } | %i[user_public_group user_internal_group user_private_group] + :external | {} | %i[public_group user_public_group user_internal_group user_private_group] + + :admin_without_admin_mode | { all_available: true } | %i[public_group internal_group user_public_group + user_internal_group user_private_group] + :admin_without_admin_mode | { all_available: false } | %i[user_public_group user_internal_group user_private_group] + :admin_without_admin_mode | {} | %i[public_group internal_group user_public_group user_internal_group user_private_group] + + :admin_with_admin_mode | { all_available: true } | %i[public_group internal_group private_group user_public_group + user_internal_group user_private_group] + :admin_with_admin_mode | { all_available: false } | %i[user_public_group user_internal_group user_private_group] + :admin_with_admin_mode | {} | %i[public_group internal_group private_group user_public_group user_internal_group + user_private_group] end with_them do diff --git a/spec/finders/license_template_finder_spec.rb b/spec/finders/license_template_finder_spec.rb index 754b92faccc..21c4cf74fd0 100644 --- a/spec/finders/license_template_finder_spec.rb +++ b/spec/finders/license_template_finder_spec.rb @@ -75,7 +75,7 @@ RSpec.describe LicenseTemplateFinder do context 'template names hash keys' do it 'has all the expected keys' do - expect(template_names.values.flatten.first.keys).to match_array(%i(id key name project_id)) + expect(template_names.values.flatten.first.keys).to match_array(%i[id key name project_id]) end end end diff --git a/spec/finders/merge_requests_finder_spec.rb b/spec/finders/merge_requests_finder_spec.rb index 9aa98189f30..3f9c1baec82 100644 --- a/spec/finders/merge_requests_finder_spec.rb +++ b/spec/finders/merge_requests_finder_spec.rb @@ -163,9 +163,9 @@ RSpec.describe MergeRequestsFinder, feature_category: :code_review_workflow do it { is_expected.to eq([merge_request2]) } it 'queries merge_request_metrics.target_project_id table' do - expect(query.to_sql).to include(%{"merge_request_metrics"."target_project_id" = #{merge_request2.target_project_id}}) + expect(query.to_sql).to include(%("merge_request_metrics"."target_project_id" = #{merge_request2.target_project_id})) - expect(query.to_sql).not_to include(%{"merge_requests"."target_project_id"}) + expect(query.to_sql).not_to include(%("merge_requests"."target_project_id")) end end end @@ -537,7 +537,7 @@ RSpec.describe MergeRequestsFinder, feature_category: :code_review_workflow do context 'filtering by approved by username' do let(:params) { { approved_by_usernames: user2.username } } - where(:sort) { [nil] + %w(milestone merged_at merged_at_desc closed_at closed_at_desc) } + where(:sort) { [nil] + %w[milestone merged_at merged_at_desc closed_at closed_at_desc] } before do create(:approval, merge_request: merge_request3, user: user2) diff --git a/spec/finders/tags_finder_spec.rb b/spec/finders/tags_finder_spec.rb index 2af23c466fb..525c19ba137 100644 --- a/spec/finders/tags_finder_spec.rb +++ b/spec/finders/tags_finder_spec.rb @@ -133,7 +133,7 @@ RSpec.describe TagsFinder do it 'filters tags' do result = subject - expect(result.map(&:name)).to eq(%w(v1.1.0)) + expect(result.map(&:name)).to eq(%w[v1.1.0]) end end @@ -143,7 +143,7 @@ RSpec.describe TagsFinder do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(v1.1.1)) + expect(result.map(&:name)).to eq(%w[v1.1.1]) end end @@ -153,7 +153,7 @@ RSpec.describe TagsFinder do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(v1.0.0 v1.1.0)) + expect(result.map(&:name)).to eq(%w[v1.0.0 v1.1.0]) end end @@ -174,7 +174,7 @@ RSpec.describe TagsFinder do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(v1.1.1 v1.1.0 v1.0.0)) + expect(result.map(&:name)).to eq(%w[v1.1.1 v1.1.0 v1.0.0]) end end @@ -184,7 +184,7 @@ RSpec.describe TagsFinder do it 'filters branches' do result = subject - expect(result.map(&:name)).to eq(%w(v1.1.0 v1.0.0)) + expect(result.map(&:name)).to eq(%w[v1.1.0 v1.0.0]) end end end @@ -195,7 +195,7 @@ RSpec.describe TagsFinder do it 'ignores the pagination for search' do result = subject - expect(result.map(&:name)).to eq(%w(v1.1.1)) + expect(result.map(&:name)).to eq(%w[v1.1.1]) end end end diff --git a/spec/finders/template_finder_spec.rb b/spec/finders/template_finder_spec.rb index eacce0bd996..57956b5aa95 100644 --- a/spec/finders/template_finder_spec.rb +++ b/spec/finders/template_finder_spec.rb @@ -189,7 +189,7 @@ RSpec.describe TemplateFinder do context 'template names hash keys' do it 'has all the expected keys' do - expect(result.first.to_h.keys).to match_array(%i(id key name project_id)) + expect(result.first.to_h.keys).to match_array(%i[id key name project_id]) end end end @@ -223,7 +223,7 @@ RSpec.describe TemplateFinder do context 'template names hash keys' do it 'has all the expected keys' do - expect(result.first.to_h.keys).to match_array(%i(id key name project_id)) + expect(result.first.to_h.keys).to match_array(%i[id key name project_id]) end end end |