A platform for community discussion. Free, open, simple.
DEV: lint against Layout/EmptyLineBetweenDefs (#24914)
Kelv2477bcc32ee6
diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rbindex ae42623b313..047694cbd1d 100644--- a/app/controllers/admin/dashboard_controller.rb+++ b/app/controllers/admin/dashboard_controller.rb@@ -14,8 +14,10 @@ class Admin::DashboardController < Admin::StaffControllerdef moderationend+def securityend+def reportsenddiff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rbindex b379271f92f..2d8fa36382d 100644--- a/app/controllers/application_controller.rb+++ b/app/controllers/application_controller.rb@@ -123,6 +123,7 @@ class ApplicationController < ActionController::Baseclass RenderEmpty < StandardErrorend+class PluginDisabled < StandardErrorenddiff --git a/app/jobs/regular/pull_hotlinked_images.rb b/app/jobs/regular/pull_hotlinked_images.rbindex ec8a7c78d6b..1bd41e71cf2 100644--- a/app/jobs/regular/pull_hotlinked_images.rb+++ b/app/jobs/regular/pull_hotlinked_images.rb@@ -112,8 +112,10 @@ module Jobsclass ImageTooLargeError < StandardErrorend+class ImageBrokenError < StandardErrorend+class UploadCreateError < StandardErrorenddiff --git a/app/models/concerns/has_custom_fields.rb b/app/models/concerns/has_custom_fields.rbindex 237439b73b3..503103691d3 100644--- a/app/models/concerns/has_custom_fields.rb+++ b/app/models/concerns/has_custom_fields.rb@@ -206,6 +206,7 @@ module HasCustomFieldsclass NotPreloadedError < StandardErrorend+class PreloadedProxydef initialize(preloaded, klass_with_custom_fields)@preloaded = preloadeddiff --git a/app/models/discourse_connect.rb b/app/models/discourse_connect.rbindex d10917812a8..59b7e1f5981 100644--- a/app/models/discourse_connect.rb+++ b/app/models/discourse_connect.rb@@ -3,6 +3,7 @@class DiscourseConnect < DiscourseConnectBaseclass BlankExternalId < StandardErrorend+class BannedExternalId < StandardErrorenddiff --git a/app/models/invite.rb b/app/models/invite.rbindex 213bb6a99ae..e0bd78ad6ff 100644--- a/app/models/invite.rb+++ b/app/models/invite.rb@@ -3,8 +3,10 @@class Invite < ActiveRecord::Baseclass UserExists < StandardErrorend+class RedemptionFailed < StandardErrorend+class ValidationFailed < StandardErrorenddiff --git a/app/models/tag.rb b/app/models/tag.rbindex ac32eee2a70..b258cea67fd 100644--- a/app/models/tag.rb+++ b/app/models/tag.rb@@ -250,6 +250,7 @@ class Tag < ActiveRecord::Basedef sanitize_descriptionself.description = sanitize_field(self.description) if description_changed?end+def name_validatorerrors.add(:name, :invalid) if name.present? && RESERVED_TAGS.include?(self.name.strip.downcase)enddiff --git a/app/models/topic.rb b/app/models/topic.rbindex fab6c594b0d..b06cb3a1341 100644--- a/app/models/topic.rb+++ b/app/models/topic.rb@@ -3,6 +3,7 @@class Topic < ActiveRecord::Baseclass UserExists < StandardErrorend+class NotAllowed < StandardErrorendinclude RateLimiter::OnCreateRecorddiff --git a/app/serializers/application_serializer.rb b/app/serializers/application_serializer.rbindex aeecb045916..9f54d4ed0ca 100644--- a/app/serializers/application_serializer.rb+++ b/app/serializers/application_serializer.rb@@ -9,6 +9,7 @@ class ApplicationSerializer < ActiveModel::Serializerdef initialize(json)@json = jsonend+def as_json(*_args)@jsonenddiff --git a/app/services/external_upload_manager.rb b/app/services/external_upload_manager.rbindex 644bcb4e0e2..352d70d6d66 100644--- a/app/services/external_upload_manager.rb+++ b/app/services/external_upload_manager.rb@@ -9,10 +9,13 @@ class ExternalUploadManagerclass ChecksumMismatchError < StandardErrorend+class DownloadFailedError < StandardErrorend+class CannotPromoteError < StandardErrorend+class SizeMismatchError < StandardErrorenddiff --git a/db/migrate/20120720013733_add_username_lower_to_users.rb b/db/migrate/20120720013733_add_username_lower_to_users.rbindex d396aa9bef5..64228deec51 100644--- a/db/migrate/20120720013733_add_username_lower_to_users.rb+++ b/db/migrate/20120720013733_add_username_lower_to_users.rb@@ -7,6 +7,7 @@ class AddUsernameLowerToUsers < ActiveRecord::Migration[4.2]add_index :users, [:username_lower], unique: truechange_column :users, :username_lower, :string, limit: 20, null: falseend+def downremove_column :users, :username_lowerenddiff --git a/db/migrate/20120809174649_create_post_actions.rb b/db/migrate/20120809174649_create_post_actions.rbindex a76ea9ede93..5e5d67f3a77 100644--- a/db/migrate/20120809174649_create_post_actions.rb+++ b/db/migrate/20120809174649_create_post_actions.rb@@ -16,6 +16,7 @@ class CreatePostActions < ActiveRecord::Migration[4.2]execute "create unique index idx_unique_actions onpost_actions(user_id, post_action_type_id, post_id) where deleted_at is null"end+def downdrop_table :post_actionsenddiff --git a/db/migrate/20130121231352_add_tracking_to_topic_users.rb b/db/migrate/20130121231352_add_tracking_to_topic_users.rbindex 5ebe50af33f..dd645815465 100644--- a/db/migrate/20130121231352_add_tracking_to_topic_users.rb+++ b/db/migrate/20130121231352_add_tracking_to_topic_users.rb@@ -4,6 +4,7 @@ class AddTrackingToTopicUsers < ActiveRecord::Migration[4.2]def upexecute "update topic_users set notification_level = 3 where notification_level = 2"end+def downexecute "update topic_users set notification_level = 2 where notification_level = 3"enddiff --git a/db/migrate/20130204000159_add_ip_address_to_users.rb b/db/migrate/20130204000159_add_ip_address_to_users.rbindex 9fab5fefa7e..e8945e94e8b 100644--- a/db/migrate/20130204000159_add_ip_address_to_users.rb+++ b/db/migrate/20130204000159_add_ip_address_to_users.rb@@ -4,6 +4,7 @@ class AddIpAddressToUsers < ActiveRecord::Migration[4.2]def upexecute "alter table users add column ip_address inet"end+def downexecute "alter table users drop column ip_address"enddiff --git a/db/migrate/20140227104930_add_custom_email_in_to_categories.rb b/db/migrate/20140227104930_add_custom_email_in_to_categories.rbindex b74a227b086..f1e24eac2a3 100644--- a/db/migrate/20140227104930_add_custom_email_in_to_categories.rb+++ b/db/migrate/20140227104930_add_custom_email_in_to_categories.rb@@ -6,6 +6,7 @@ class AddCustomEmailInToCategories < ActiveRecord::Migration[4.2]add_column :categories, :email_in_allow_strangers, :boolean, default: falseadd_index :categories, :email_in, unique: trueend+def downremove_column :categories, :email_inremove_column :categories, :email_in_allow_strangersdiff --git a/db/migrate/20140911065449_private_messages_have_no_category_id.rb b/db/migrate/20140911065449_private_messages_have_no_category_id.rbindex 5f7b2c7a822..6bc70772a5d 100644--- a/db/migrate/20140911065449_private_messages_have_no_category_id.rb+++ b/db/migrate/20140911065449_private_messages_have_no_category_id.rb@@ -5,6 +5,7 @@ class PrivateMessagesHaveNoCategoryId < ActiveRecord::Migration[4.2]execute "UPDATE topics SET category_id = NULL WHERE category_id IS NOT NULL AND archetype = \'private_message\'"execute "ALTER TABLE topics ADD CONSTRAINT pm_has_no_category CHECK (category_id IS NULL OR archetype <> 'private_message')"end+def downraise ActiveRecord::IrreversibleMigrationenddiff --git a/db/migrate/20150206004143_flush_application_requests.rb b/db/migrate/20150206004143_flush_application_requests.rbindex 0270f3325a8..79b0ca86f62 100644--- a/db/migrate/20150206004143_flush_application_requests.rb+++ b/db/migrate/20150206004143_flush_application_requests.rb@@ -5,6 +5,7 @@ class FlushApplicationRequests < ActiveRecord::Migration[4.2]# flush as enum changedexecute "TRUNCATE TABLE application_requests"end+def downendenddiff --git a/db/migrate/20150713203955_enlarge_users_email_field.rb b/db/migrate/20150713203955_enlarge_users_email_field.rbindex 84feafafd29..f38d6b294ec 100644--- a/db/migrate/20150713203955_enlarge_users_email_field.rb+++ b/db/migrate/20150713203955_enlarge_users_email_field.rb@@ -4,6 +4,7 @@ class EnlargeUsersEmailField < ActiveRecord::Migration[4.2]def upchange_column :users, :email, :string, limit: 513end+def downchange_column :users, :email, :string, limit: 128enddiff --git a/db/migrate/20160520022627_shorten_topic_custom_fields_index.rb b/db/migrate/20160520022627_shorten_topic_custom_fields_index.rbindex c3371cf4266..0737a16f738 100644--- a/db/migrate/20160520022627_shorten_topic_custom_fields_index.rb+++ b/db/migrate/20160520022627_shorten_topic_custom_fields_index.rb@@ -8,6 +8,7 @@ class ShortenTopicCustomFieldsIndex < ActiveRecord::Migration[4.2]name: "topic_custom_fields_value_key_idx",where: "value IS NOT NULL AND char_length(value) < 400"end+def downremove_index :topic_custom_fields, :value, name: "topic_custom_fields_value_key_idx"add_index :topic_custom_fields, :valuediff --git a/db/migrate/20180207161422_add_skipped_created_at_user_id_index_on_email_logs.rb b/db/migrate/20180207161422_add_skipped_created_at_user_id_index_on_email_logs.rbindex baeb2fc0b9d..6c4ea44e323 100644--- a/db/migrate/20180207161422_add_skipped_created_at_user_id_index_on_email_logs.rb+++ b/db/migrate/20180207161422_add_skipped_created_at_user_id_index_on_email_logs.rb@@ -4,6 +4,7 @@ class AddSkippedCreatedAtUserIdIndexOnEmailLogs < ActiveRecord::Migration[5.1]def upexecute "CREATE INDEX idx_email_logs_user_created_filtered ON email_logs(user_id, created_at) WHERE skipped = 'f'"end+def downexecute "DROP INDEX idx_email_logs_user_created_filtered"enddiff --git a/db/migrate/20180221215641_add_suppress_from_latest_to_categories.rb b/db/migrate/20180221215641_add_suppress_from_latest_to_categories.rbindex 0d926c4c4cc..bd8a81fa175 100644--- a/db/migrate/20180221215641_add_suppress_from_latest_to_categories.rb+++ b/db/migrate/20180221215641_add_suppress_from_latest_to_categories.rb@@ -7,6 +7,7 @@ class AddSuppressFromLatestToCategories < ActiveRecord::Migration[5.1]UPDATE categories SET suppress_from_latest = suppress_from_homepageSQLend+def downraise "can not be removed"enddiff --git a/db/migrate/20180928105835_add_index_to_tags.rb b/db/migrate/20180928105835_add_index_to_tags.rbindex 54a3ab0702c..07645140437 100644--- a/db/migrate/20180928105835_add_index_to_tags.rb+++ b/db/migrate/20180928105835_add_index_to_tags.rb@@ -13,6 +13,7 @@ class AddIndexToTags < ActiveRecord::Migration[5.2]add_index :tags, "lower(name)", unique: trueend+def downraise ActiveRecord::IrreversibleMigrationenddiff --git a/db/migrate/20190513143015_add_theme_id_to_javascript_cache.rb b/db/migrate/20190513143015_add_theme_id_to_javascript_cache.rbindex 16710de3ee8..66494fd8487 100644--- a/db/migrate/20190513143015_add_theme_id_to_javascript_cache.rb+++ b/db/migrate/20190513143015_add_theme_id_to_javascript_cache.rb@@ -14,6 +14,7 @@ class AddThemeIdToJavascriptCache < ActiveRecord::Migration[5.2]make_changesexecute "ALTER TABLE javascript_caches ADD CONSTRAINT enforce_theme_or_theme_field CHECK ((theme_id IS NOT NULL AND theme_field_id IS NULL) OR (theme_id IS NULL AND theme_field_id IS NOT NULL))"end+def downexecute "ALTER TABLE javascript_caches DROP CONSTRAINT enforce_theme_or_theme_field"revert { make_changes }diff --git a/db/migrate/20200424032633_remove_canonical_email_from_user_emails.rb b/db/migrate/20200424032633_remove_canonical_email_from_user_emails.rbindex 8d5a0c9ff3f..b1825e7973f 100644--- a/db/migrate/20200424032633_remove_canonical_email_from_user_emails.rb+++ b/db/migrate/20200424032633_remove_canonical_email_from_user_emails.rb@@ -7,6 +7,7 @@ class RemoveCanonicalEmailFromUserEmails < ActiveRecord::Migration[6.0]DROP COLUMN IF EXISTS canonical_emailSQLend+def down# nothing to do, we already nuke the migrationsenddiff --git a/lib/auth/current_user_provider.rb b/lib/auth/current_user_provider.rbindex f12e992de3d..ed214aca7b4 100644--- a/lib/auth/current_user_provider.rb+++ b/lib/auth/current_user_provider.rb@@ -2,6 +2,7 @@module Authend+class Auth::CurrentUserProvider# do all current user initialization heredef initialize(env)diff --git a/lib/autospec/rspec_runner.rb b/lib/autospec/rspec_runner.rbindex e5efa38e2ea..d77d01e4723 100644--- a/lib/autospec/rspec_runner.rb+++ b/lib/autospec/rspec_runner.rb@@ -6,6 +6,7 @@ module Autospecdef self.watch(pattern, &blk)WATCHERS[pattern] = blkend+def watchersWATCHERSend@@ -41,6 +42,7 @@ module Autospecdef self.reload(pattern)RELOADERS << patternend+def reloadersRELOADERSenddiff --git a/lib/chrome_installed_checker.rb b/lib/chrome_installed_checker.rbindex 2f8c2824cc9..c0b292b2b03 100644--- a/lib/chrome_installed_checker.rb+++ b/lib/chrome_installed_checker.rb@@ -5,10 +5,13 @@ require "rbconfig"class ChromeInstalledCheckerclass ChromeError < StandardErrorend+class ChromeVersionError < ChromeErrorend+class ChromeNotInstalled < ChromeErrorend+class ChromeVersionTooLow < ChromeErrorenddiff --git a/lib/discourse_connect_provider.rb b/lib/discourse_connect_provider.rbindex 7625b8b5c47..4d2ee6991f6 100644--- a/lib/discourse_connect_provider.rb+++ b/lib/discourse_connect_provider.rb@@ -3,8 +3,10 @@class DiscourseConnectProvider < DiscourseConnectBaseclass BlankSecret < RuntimeErrorend+class BlankReturnUrl < RuntimeErrorend+class InvalidParameterValueError < RuntimeErrorattr_reader :paramdef initialize(param)diff --git a/lib/discourse_webauthn.rb b/lib/discourse_webauthn.rbindex 7756495ec2e..b6857f68315 100644--- a/lib/discourse_webauthn.rb+++ b/lib/discourse_webauthn.rb@@ -14,32 +14,46 @@ module DiscourseWebauthnclass InvalidOriginError < SecurityKeyErrorend+class InvalidRelyingPartyIdError < SecurityKeyErrorend+class UserVerificationError < SecurityKeyErrorend+class UserPresenceError < SecurityKeyErrorend+class ChallengeMismatchError < SecurityKeyErrorend+class InvalidTypeError < SecurityKeyErrorend+class UnsupportedPublicKeyAlgorithmError < SecurityKeyErrorend+class UnsupportedAttestationFormatError < SecurityKeyErrorend+class CredentialIdInUseError < SecurityKeyErrorend+class MalformedAttestationError < SecurityKeyErrorend+class KeyNotFoundError < SecurityKeyErrorend+class MalformedPublicKeyCredentialError < SecurityKeyErrorend+class OwnershipError < SecurityKeyErrorend+class PublicKeyError < SecurityKeyErrorend+class UnknownCOSEAlgorithmError < SecurityKeyErrorenddiff --git a/lib/email/receiver.rb b/lib/email/receiver.rbindex 004c76c1f41..dfcc083cebf 100644--- a/lib/email/receiver.rb+++ b/lib/email/receiver.rb@@ -9,52 +9,76 @@ module Email# * add text to server.en.yml (parent key: "emails.incoming.errors")class ProcessingError < StandardErrorend+class EmptyEmailError < ProcessingErrorend+class ScreenedEmailError < ProcessingErrorend+class UserNotFoundError < ProcessingErrorend+class AutoGeneratedEmailError < ProcessingErrorend+class BouncedEmailError < ProcessingErrorend+class NoBodyDetectedError < ProcessingErrorend+class NoSenderDetectedError < ProcessingErrorend+class FromReplyByAddressError < ProcessingErrorend+class InactiveUserError < ProcessingErrorend+class SilencedUserError < ProcessingErrorend+class BadDestinationAddress < ProcessingErrorend+class StrangersNotAllowedError < ProcessingErrorend+class ReplyNotAllowedError < ProcessingErrorend+class InsufficientTrustLevelError < ProcessingErrorend+class ReplyUserNotMatchingError < ProcessingErrorend+class TopicNotFoundError < ProcessingErrorend+class TopicClosedError < ProcessingErrorend+class InvalidPost < ProcessingErrorend+class TooShortPost < ProcessingErrorend+class InvalidPostAction < ProcessingErrorend+class UnsubscribeNotAllowed < ProcessingErrorend+class EmailNotAllowed < ProcessingErrorend+class OldDestinationError < ProcessingErrorend+class ReplyToDigestError < ProcessingErrorenddiff --git a/lib/final_destination.rb b/lib/final_destination.rbindex 0c107af9503..a67a0810774 100644--- a/lib/final_destination.rb+++ b/lib/final_destination.rb@@ -10,6 +10,7 @@ require "url_helper"class FinalDestinationclass SSRFError < SocketErrorend+class UrlEncodingError < ArgumentErrorenddiff --git a/lib/final_destination/ssrf_detector.rb b/lib/final_destination/ssrf_detector.rbindex dcb20644f73..b3da5d07db3 100644--- a/lib/final_destination/ssrf_detector.rb+++ b/lib/final_destination/ssrf_detector.rb@@ -4,6 +4,7 @@ class FinalDestinationmodule SSRFDetectorclass DisallowedIpError < SSRFErrorend+class LookupFailedError < SSRFErrorenddiff --git a/lib/guardian.rb b/lib/guardian.rbindex a069ad8867a..d5e5b8243ac 100644--- a/lib/guardian.rb+++ b/lib/guardian.rb@@ -28,51 +28,67 @@ class Guardiandef blank?trueend+def admin?falseend+def staff?falseend+def moderator?falseend+def anonymous?trueend+def approved?falseend+def staged?falseend+def silenced?falseend+def is_system_user?falseend+def bot?falseend+def secure_category_ids[]end+def groups[]end+def has_trust_level?(level)falseend+def has_trust_level_or_staff?(level)falseend+def emailnilend+def whisperer?falseend+def in_any_groups?(group_ids)falseenddiff --git a/lib/import/normalize.rb b/lib/import/normalize.rbindex 8b9b98b8e06..71649eb059a 100644--- a/lib/import/normalize.rb+++ b/lib/import/normalize.rb@@ -6,6 +6,7 @@require "htmlentities"module Importend+module Import::Normalizedef self.normalize_code_blocks(code, lang = nil)coder = HTMLEntities.newdiff --git a/lib/migration/safe_migrate.rb b/lib/migration/safe_migrate.rbindex b43bc38b029..def669ff037 100644--- a/lib/migration/safe_migrate.rb+++ b/lib/migration/safe_migrate.rb@@ -56,6 +56,7 @@ class Migration::SafeMigratedef e.causenilend+def e.backtracesuper.reject do |frame|frame =~ /safe_migrate\.rb/ || frame =~ /schema_migration_details\.rb/diff --git a/lib/mini_sql_multisite_connection.rb b/lib/mini_sql_multisite_connection.rbindex 675d372686f..09e2b71f5f8 100644--- a/lib/mini_sql_multisite_connection.rb+++ b/lib/mini_sql_multisite_connection.rb@@ -39,8 +39,10 @@ class MiniSqlMultisiteConnection < MiniSql::ActiveRecordPostgres::Connectiondef before_committed!(*)end+def rolledback!(*)end+def trigger_transactional_callbacks?trueenddiff --git a/lib/presence_channel.rb b/lib/presence_channel.rbindex 6e54b422b58..3e4854cd964 100644--- a/lib/presence_channel.rb+++ b/lib/presence_channel.rb@@ -5,10 +5,13 @@class PresenceChannelclass NotFound < StandardErrorend+class InvalidAccess < StandardErrorend+class ConfigNotLoaded < StandardErrorend+class InvalidConfig < StandardErrorenddiff --git a/plugins/chat/lib/chat/message_mover.rb b/plugins/chat/lib/chat/message_mover.rbindex 93747a26cdb..ae5e8c4be96 100644--- a/plugins/chat/lib/chat/message_mover.rb+++ b/plugins/chat/lib/chat/message_mover.rb@@ -32,6 +32,7 @@ module Chatclass MessageMoverclass NoMessagesFound < StandardErrorend+class InvalidChannel < StandardErrorenddiff --git a/script/import_scripts/phpbb3/support/bbcode/markdown_node.rb b/script/import_scripts/phpbb3/support/bbcode/markdown_node.rbindex c5e5048a9f1..0724b6e63ce 100644--- a/script/import_scripts/phpbb3/support/bbcode/markdown_node.rb+++ b/script/import_scripts/phpbb3/support/bbcode/markdown_node.rb@@ -2,6 +2,7 @@module ImportScriptsend+module ImportScripts::PhpBB3enddiff --git a/script/import_scripts/smf2.rb b/script/import_scripts/smf2.rbindex defa13292f6..b8d697b2b3a 100644--- a/script/import_scripts/smf2.rb+++ b/script/import_scripts/smf2.rb@@ -585,6 +585,7 @@ class ImportScripts::Smf2 < ImportScripts::Baseclass Optionsclass Error < StandardErrorend+class SettingsError < Errorenddiff --git a/script/thread_detective.rb b/script/thread_detective.rbindex 83e886d085c..d72fd5e8ae2 100644--- a/script/thread_detective.rb+++ b/script/thread_detective.rb@@ -8,6 +8,7 @@ class ThreadDetectivedef self.test_threadThread.new { sleep 1 }end+def self.start(max_threads)@thread ||= Thread.new { self.new.monitor(max_threads) }diff --git a/spec/lib/auth/managed_authenticator_spec.rb b/spec/lib/auth/managed_authenticator_spec.rbindex 7bd037c5352..aa9a0439603 100644--- a/spec/lib/auth/managed_authenticator_spec.rb+++ b/spec/lib/auth/managed_authenticator_spec.rb@@ -123,6 +123,7 @@ RSpec.describe Auth::ManagedAuthenticator dodef name"myauth"end+def can_connect_existing_user?falseend@@ -164,6 +165,7 @@ RSpec.describe Auth::ManagedAuthenticator dodef name"myauth"end+def match_by_emailfalseend@@ -328,9 +330,11 @@ RSpec.describe Auth::ManagedAuthenticator dodef name"myauth"end+def match_by_emailfalseend+def match_by_usernametrueend@@ -395,6 +399,7 @@ RSpec.describe Auth::ManagedAuthenticator dodef name"myauth"end+def match_by_usernamefalseenddiff --git a/spec/lib/plugin/instance_spec.rb b/spec/lib/plugin/instance_spec.rbindex 8078bae096c..19257bd8df8 100644--- a/spec/lib/plugin/instance_spec.rb+++ b/spec/lib/plugin/instance_spec.rb@@ -68,6 +68,7 @@ RSpec.describe Plugin::Instance do"a trout"endend+class TroutJuniorSerializer < TroutSerializerattribute :i_am_childdiff --git a/spec/lib/site_setting_extension_spec.rb b/spec/lib/site_setting_extension_spec.rbindex ec17f5f0af0..3f233471dbc 100644--- a/spec/lib/site_setting_extension_spec.rb+++ b/spec/lib/site_setting_extension_spec.rb@@ -390,6 +390,7 @@ RSpec.describe SiteSettingExtension dodef self.valid_value?(v)trueend+def self.values[1, 2, 3]end@@ -409,9 +410,11 @@ RSpec.describe SiteSettingExtension dodef self.valid_value?(v)self.values.include?(v)end+def self.values["en"]end+def self.translate_names?falseenddiff --git a/spec/lib/site_settings/type_supervisor_spec.rb b/spec/lib/site_settings/type_supervisor_spec.rbindex c12be5dc9c2..d0862f8ef8b 100644--- a/spec/lib/site_settings/type_supervisor_spec.rb+++ b/spec/lib/site_settings/type_supervisor_spec.rb@@ -136,9 +136,11 @@ RSpec.describe SiteSettings::TypeSupervisor dodef self.valid_value?(v)self.values.include?(v)end+def self.values["en"]end+def self.translate_names?falseend@@ -147,9 +149,11 @@ RSpec.describe SiteSettings::TypeSupervisor doclass TestSmallThanTenValidatordef initialize(opts)end+def valid_value?(v)v < 10end+def error_message""end@@ -408,9 +412,11 @@ RSpec.describe SiteSettings::TypeSupervisor dodef self.valid_value?(v)self.values.include?(v)end+def self.values%w[a b]end+def self.translate_names?falseenddiff --git a/spec/support/imap_helper.rb b/spec/support/imap_helper.rbindex 8476192ef8e..88f71875f3c 100644--- a/spec/support/imap_helper.rb+++ b/spec/support/imap_helper.rb@@ -3,8 +3,10 @@class MockedImapProvider < Imap::Providers::Gmaildef connect!end+def disconnect!end+def open_mailbox(mailbox_name, write: false)enddiff --git a/spec/system/page_objects/admin_user_badges.rb b/spec/system/page_objects/admin_user_badges.rbindex 7cb746ee5ac..b6ffe4426a0 100644--- a/spec/system/page_objects/admin_user_badges.rb+++ b/spec/system/page_objects/admin_user_badges.rb@@ -11,6 +11,7 @@ module PageObjectsdef user_badges_tablepage.find(:table, id: "user-badges", visible: true)end+def find_badge_row_by_granter(granter)user_badges_table.find(:table_row, { "Granted By" => "#{granter.username}" })enddiff --git a/spec/system/page_objects/modals/badge.rb b/spec/system/page_objects/modals/badge.rbindex c0af307772f..48ea9e8b0cd 100644--- a/spec/system/page_objects/modals/badge.rb+++ b/spec/system/page_objects/modals/badge.rb@@ -8,6 +8,7 @@ module PageObjectsdef modalfind(".grant-badge-modal")end+def select_badge(badge_name)within(modal) dograntable_badges_dropdown.expanddiff --git a/spec/system/page_objects/modals/change_owner.rb b/spec/system/page_objects/modals/change_owner.rbindex f5d2312e94b..25252fed2be 100644--- a/spec/system/page_objects/modals/change_owner.rb+++ b/spec/system/page_objects/modals/change_owner.rb@@ -8,6 +8,7 @@ module PageObjectsdef modalfind(".change-ownership-modal")end+def select_new_owner(user)within(modal) dousers_dropdown.expand