DEV: Fix various rubocop lints (#24749)

These (21 + 3 from previous PRs) are soon to be enabled in rubocop-discourse:

Capybara/VisibilityMatcher
Lint/DeprecatedOpenSSLConstant
Lint/DisjunctiveAssignmentInConstructor
Lint/EmptyConditionalBody
Lint/EmptyEnsure
Lint/LiteralInInterpolation
Lint/NonLocalExitFromIterator
Lint/ParenthesesAsGroupedExpression
Lint/RedundantCopDisableDirective
Lint/RedundantRequireStatement
Lint/RedundantSafeNavigation
Lint/RedundantStringCoercion
Lint/RedundantWithIndex
Lint/RedundantWithObject
Lint/SafeNavigationChain
Lint/SafeNavigationConsistency
Lint/SelfAssignment
Lint/UnreachableCode
Lint/UselessMethodDefinition
Lint/Void

Previous PRs:
Lint/ShadowedArgument
Lint/DuplicateMethods
Lint/BooleanSymbol
RSpec/SpecFilePathSuffix
This commit is contained in:
Jarek Radosz
2023-12-06 23:25:00 +01:00
committed by GitHub
parent 47f298b2f4
commit 694b5f108b
129 changed files with 196 additions and 274 deletions

View File

@ -487,10 +487,10 @@ RSpec.describe Plugin::Instance do
expect(
JsLocaleHelper.find_message_format_locale(["foo_BAR"], fallback_to_english: true),
).to eq(locale[:message_format])
expect(JsLocaleHelper.find_moment_locale(["foo_BAR"])).to eq (locale[:moment_js])
expect(JsLocaleHelper.find_moment_locale(["foo_BAR"], timezone_names: true)).to eq (
locale[:moment_js_timezones]
)
expect(JsLocaleHelper.find_moment_locale(["foo_BAR"])).to eq(locale[:moment_js])
expect(JsLocaleHelper.find_moment_locale(["foo_BAR"], timezone_names: true)).to eq(
locale[:moment_js_timezones],
)
end
it "correctly registers a new locale using a fallback locale" do
@ -516,7 +516,7 @@ RSpec.describe Plugin::Instance do
expect(JsLocaleHelper.find_message_format_locale(["tup"], fallback_to_english: true)).to eq(
locale[:message_format],
)
expect(JsLocaleHelper.find_moment_locale(["tup"])).to eq (locale[:moment_js])
expect(JsLocaleHelper.find_moment_locale(["tup"])).to eq(locale[:moment_js])
end
it "correctly registers a new locale when some files exist in core" do
@ -539,7 +539,7 @@ RSpec.describe Plugin::Instance do
expect(JsLocaleHelper.find_message_format_locale(["tlh"], fallback_to_english: true)).to eq(
locale[:message_format],
)
expect(JsLocaleHelper.find_moment_locale(["tlh"])).to eq (locale[:moment_js])
expect(JsLocaleHelper.find_moment_locale(["tlh"])).to eq(locale[:moment_js])
end
it "does not register a new locale when the fallback locale does not exist" do