From b0c3fa1bcc9d2f26dddebf8f37dd7dff7d980302 Mon Sep 17 00:00:00 2001 From: archanaserver Date: Fri, 26 Jan 2024 12:38:37 +0530 Subject: [PATCH 1/3] Fix Minitest/RefuteIncludes cop --- test/functional/api/v2/template_controller_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/api/v2/template_controller_test.rb b/test/functional/api/v2/template_controller_test.rb index 1045f206..3e824fb0 100644 --- a/test/functional/api/v2/template_controller_test.rb +++ b/test/functional/api/v2/template_controller_test.rb @@ -26,7 +26,7 @@ class TemplateControllerTest < ::ActionController::TestCase FactoryBot.create(:provisioning_template, :name => 'export_test_template') post :export, params: { "repo" => tmpdir, "filter" => "^export_test_template", "negate" => true, "metadata_export_mode" => "keep" } assert_response :success - refute_includes(Dir.entries("#{tmpdir}/provisioning_templates/provision"), 'export_test_template.erb') + refute_includes Dir.entries("#{tmpdir}/provisioning_templates/provision"), 'export_test_template.erb' end end From 101e27bbd2f2f82e709d7c237a2b37e30831d854 Mon Sep 17 00:00:00 2001 From: archanaserver Date: Fri, 26 Jan 2024 12:40:15 +0530 Subject: [PATCH 2/3] Fix Minitest/AssertIncludes cop --- test/unit/template_exporter_test.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/unit/template_exporter_test.rb b/test/unit/template_exporter_test.rb index fb238dd2..239ffffe 100644 --- a/test/unit/template_exporter_test.rb +++ b/test/unit/template_exporter_test.rb @@ -62,11 +62,7 @@ class TemplateExporterTest < ActiveSupport::TestCase templates = exporter.templates_to_dump assert_equal 1, templates.count assert_includes(templates, template) - end end - - describe '#templates_to_dump based on taxonomy context' do - before do taxonomy_setup @before_org = Organization.current Organization.current = @org From 283964b2e6af0ef976b48e7d1f2897def8b19b74 Mon Sep 17 00:00:00 2001 From: archanaserver Date: Fri, 26 Jan 2024 13:07:50 +0530 Subject: [PATCH 3/3] Fix Layout/ExtraSpacing cop --- .rubocop.yml | 6 ++++++ test/functional/api/v2/template_controller_test.rb | 2 +- test/unit/template_exporter_test.rb | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index d60709b8..5497bde3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -98,6 +98,12 @@ Metrics: Lint/UnusedMethodArgument: Enabled: false +Lint/ConstantDefinitionInBlock: + Enabled: false + +Layout/ExtraSpacing: + Enabled: true + # JobTemplates use this for inputs, we should probably whitelist classes Security/YAMLLoad: Enabled: false diff --git a/test/functional/api/v2/template_controller_test.rb b/test/functional/api/v2/template_controller_test.rb index 3e824fb0..1045f206 100644 --- a/test/functional/api/v2/template_controller_test.rb +++ b/test/functional/api/v2/template_controller_test.rb @@ -26,7 +26,7 @@ class TemplateControllerTest < ::ActionController::TestCase FactoryBot.create(:provisioning_template, :name => 'export_test_template') post :export, params: { "repo" => tmpdir, "filter" => "^export_test_template", "negate" => true, "metadata_export_mode" => "keep" } assert_response :success - refute_includes Dir.entries("#{tmpdir}/provisioning_templates/provision"), 'export_test_template.erb' + refute_includes(Dir.entries("#{tmpdir}/provisioning_templates/provision"), 'export_test_template.erb') end end diff --git a/test/unit/template_exporter_test.rb b/test/unit/template_exporter_test.rb index 239ffffe..fb238dd2 100644 --- a/test/unit/template_exporter_test.rb +++ b/test/unit/template_exporter_test.rb @@ -62,7 +62,11 @@ class TemplateExporterTest < ActiveSupport::TestCase templates = exporter.templates_to_dump assert_equal 1, templates.count assert_includes(templates, template) + end end + + describe '#templates_to_dump based on taxonomy context' do + before do taxonomy_setup @before_org = Organization.current Organization.current = @org