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

@ -153,7 +153,7 @@ RSpec.describe Chat::Api::ChannelsArchivesController do
expect { post "/chat/api/channels/#{channel.id}/archives" }.to change(
Jobs::Chat::ChannelArchive.jobs,
:size,
).by (1)
).by(1)
expect(response.status).to eq(200)
end
end

View File

@ -354,14 +354,14 @@ RSpec.describe Chat::ChatController do
sign_in(user)
expect {
post "/chat/dismiss-retention-reminder.json", params: { chatable_type: "Category" }
}.to change { user.user_option.reload.dismissed_channel_retention_reminder }.to (true)
}.to change { user.user_option.reload.dismissed_channel_retention_reminder }.to(true)
end
it "sets `dismissed_dm_retention_reminder` to true" do
sign_in(user)
expect {
post "/chat/dismiss-retention-reminder.json", params: { chatable_type: "DirectMessage" }
}.to change { user.user_option.reload.dismissed_dm_retention_reminder }.to (true)
}.to change { user.user_option.reload.dismissed_dm_retention_reminder }.to(true)
end
it "doesn't error if the fields are already true" do