Skip to content

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.rb
index 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::StaffController
def moderation
end
+
def security
end
+
def reports
end
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index b379271f92f..2d8fa36382d 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -123,6 +123,7 @@ class ApplicationController < ActionController::Base
class RenderEmpty < StandardError
end
+
class PluginDisabled < StandardError
end
diff --git a/app/jobs/regular/pull_hotlinked_images.rb b/app/jobs/regular/pull_hotlinked_images.rb
index ec8a7c78d6b..1bd41e71cf2 100644
--- a/app/jobs/regular/pull_hotlinked_images.rb
+++ b/app/jobs/regular/pull_hotlinked_images.rb
@@ -112,8 +112,10 @@ module Jobs
class ImageTooLargeError < StandardError
end
+
class ImageBrokenError < StandardError
end
+
class UploadCreateError < StandardError
end
diff --git a/app/models/concerns/has_custom_fields.rb b/app/models/concerns/has_custom_fields.rb
index 237439b73b3..503103691d3 100644
--- a/app/models/concerns/has_custom_fields.rb
+++ b/app/models/concerns/has_custom_fields.rb
@@ -206,6 +206,7 @@ module HasCustomFields
class NotPreloadedError < StandardError
end
+
class PreloadedProxy
def initialize(preloaded, klass_with_custom_fields)
@preloaded = preloaded
diff --git a/app/models/discourse_connect.rb b/app/models/discourse_connect.rb
index d10917812a8..59b7e1f5981 100644
--- a/app/models/discourse_connect.rb
+++ b/app/models/discourse_connect.rb
@@ -3,6 +3,7 @@
class DiscourseConnect < DiscourseConnectBase
class BlankExternalId < StandardError
end
+
class BannedExternalId < StandardError
end
diff --git a/app/models/invite.rb b/app/models/invite.rb
index 213bb6a99ae..e0bd78ad6ff 100644
--- a/app/models/invite.rb
+++ b/app/models/invite.rb
@@ -3,8 +3,10 @@
class Invite < ActiveRecord::Base
class UserExists < StandardError
end
+
class RedemptionFailed < StandardError
end
+
class ValidationFailed < StandardError
end
diff --git a/app/models/tag.rb b/app/models/tag.rb
index ac32eee2a70..b258cea67fd 100644
--- a/app/models/tag.rb
+++ b/app/models/tag.rb
@@ -250,6 +250,7 @@ class Tag < ActiveRecord::Base
def sanitize_description
self.description = sanitize_field(self.description) if description_changed?
end
+
def name_validator
errors.add(:name, :invalid) if name.present? && RESERVED_TAGS.include?(self.name.strip.downcase)
end
diff --git a/app/models/topic.rb b/app/models/topic.rb
index fab6c594b0d..b06cb3a1341 100644
--- a/app/models/topic.rb
+++ b/app/models/topic.rb
@@ -3,6 +3,7 @@
class Topic < ActiveRecord::Base
class UserExists < StandardError
end
+
class NotAllowed < StandardError
end
include RateLimiter::OnCreateRecord
diff --git a/app/serializers/application_serializer.rb b/app/serializers/application_serializer.rb
index aeecb045916..9f54d4ed0ca 100644
--- a/app/serializers/application_serializer.rb
+++ b/app/serializers/application_serializer.rb
@@ -9,6 +9,7 @@ class ApplicationSerializer < ActiveModel::Serializer
def initialize(json)
@json = json
end
+
def as_json(*_args)
@json
end
diff --git a/app/services/external_upload_manager.rb b/app/services/external_upload_manager.rb
index 644bcb4e0e2..352d70d6d66 100644
--- a/app/services/external_upload_manager.rb
+++ b/app/services/external_upload_manager.rb
@@ -9,10 +9,13 @@ class ExternalUploadManager
class ChecksumMismatchError < StandardError
end
+
class DownloadFailedError < StandardError
end
+
class CannotPromoteError < StandardError
end
+
class SizeMismatchError < StandardError
end
diff --git a/db/migrate/20120720013733_add_username_lower_to_users.rb b/db/migrate/20120720013733_add_username_lower_to_users.rb
index 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: true
change_column :users, :username_lower, :string, limit: 20, null: false
end
+
def down
remove_column :users, :username_lower
end
diff --git a/db/migrate/20120809174649_create_post_actions.rb b/db/migrate/20120809174649_create_post_actions.rb
index 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 on
post_actions(user_id, post_action_type_id, post_id) where deleted_at is null"
end
+
def down
drop_table :post_actions
end
diff --git a/db/migrate/20130121231352_add_tracking_to_topic_users.rb b/db/migrate/20130121231352_add_tracking_to_topic_users.rb
index 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 up
execute "update topic_users set notification_level = 3 where notification_level = 2"
end
+
def down
execute "update topic_users set notification_level = 2 where notification_level = 3"
end
diff --git a/db/migrate/20130204000159_add_ip_address_to_users.rb b/db/migrate/20130204000159_add_ip_address_to_users.rb
index 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 up
execute "alter table users add column ip_address inet"
end
+
def down
execute "alter table users drop column ip_address"
end
diff --git a/db/migrate/20140227104930_add_custom_email_in_to_categories.rb b/db/migrate/20140227104930_add_custom_email_in_to_categories.rb
index 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: false
add_index :categories, :email_in, unique: true
end
+
def down
remove_column :categories, :email_in
remove_column :categories, :email_in_allow_strangers
diff --git a/db/migrate/20140911065449_private_messages_have_no_category_id.rb b/db/migrate/20140911065449_private_messages_have_no_category_id.rb
index 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 down
raise ActiveRecord::IrreversibleMigration
end
diff --git a/db/migrate/20150206004143_flush_application_requests.rb b/db/migrate/20150206004143_flush_application_requests.rb
index 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 changed
execute "TRUNCATE TABLE application_requests"
end
+
def down
end
end
diff --git a/db/migrate/20150713203955_enlarge_users_email_field.rb b/db/migrate/20150713203955_enlarge_users_email_field.rb
index 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 up
change_column :users, :email, :string, limit: 513
end
+
def down
change_column :users, :email, :string, limit: 128
end
diff --git a/db/migrate/20160520022627_shorten_topic_custom_fields_index.rb b/db/migrate/20160520022627_shorten_topic_custom_fields_index.rb
index 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 down
remove_index :topic_custom_fields, :value, name: "topic_custom_fields_value_key_idx"
add_index :topic_custom_fields, :value
diff --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.rb
index 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 up
execute "CREATE INDEX idx_email_logs_user_created_filtered ON email_logs(user_id, created_at) WHERE skipped = 'f'"
end
+
def down
execute "DROP INDEX idx_email_logs_user_created_filtered"
end
diff --git a/db/migrate/20180221215641_add_suppress_from_latest_to_categories.rb b/db/migrate/20180221215641_add_suppress_from_latest_to_categories.rb
index 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_homepage
SQL
end
+
def down
raise "can not be removed"
end
diff --git a/db/migrate/20180928105835_add_index_to_tags.rb b/db/migrate/20180928105835_add_index_to_tags.rb
index 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: true
end
+
def down
raise ActiveRecord::IrreversibleMigration
end
diff --git a/db/migrate/20190513143015_add_theme_id_to_javascript_cache.rb b/db/migrate/20190513143015_add_theme_id_to_javascript_cache.rb
index 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_changes
execute "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 down
execute "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.rb
index 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_email
SQL
end
+
def down
# nothing to do, we already nuke the migrations
end
diff --git a/lib/auth/current_user_provider.rb b/lib/auth/current_user_provider.rb
index f12e992de3d..ed214aca7b4 100644
--- a/lib/auth/current_user_provider.rb
+++ b/lib/auth/current_user_provider.rb
@@ -2,6 +2,7 @@
module Auth
end
+
class Auth::CurrentUserProvider
# do all current user initialization here
def initialize(env)
diff --git a/lib/autospec/rspec_runner.rb b/lib/autospec/rspec_runner.rb
index e5efa38e2ea..d77d01e4723 100644
--- a/lib/autospec/rspec_runner.rb
+++ b/lib/autospec/rspec_runner.rb
@@ -6,6 +6,7 @@ module Autospec
def self.watch(pattern, &blk)
WATCHERS[pattern] = blk
end
+
def watchers
WATCHERS
end
@@ -41,6 +42,7 @@ module Autospec
def self.reload(pattern)
RELOADERS << pattern
end
+
def reloaders
RELOADERS
end
diff --git a/lib/chrome_installed_checker.rb b/lib/chrome_installed_checker.rb
index 2f8c2824cc9..c0b292b2b03 100644
--- a/lib/chrome_installed_checker.rb
+++ b/lib/chrome_installed_checker.rb
@@ -5,10 +5,13 @@ require "rbconfig"
class ChromeInstalledChecker
class ChromeError < StandardError
end
+
class ChromeVersionError < ChromeError
end
+
class ChromeNotInstalled < ChromeError
end
+
class ChromeVersionTooLow < ChromeError
end
diff --git a/lib/discourse_connect_provider.rb b/lib/discourse_connect_provider.rb
index 7625b8b5c47..4d2ee6991f6 100644
--- a/lib/discourse_connect_provider.rb
+++ b/lib/discourse_connect_provider.rb
@@ -3,8 +3,10 @@
class DiscourseConnectProvider < DiscourseConnectBase
class BlankSecret < RuntimeError
end
+
class BlankReturnUrl < RuntimeError
end
+
class InvalidParameterValueError < RuntimeError
attr_reader :param
def initialize(param)
diff --git a/lib/discourse_webauthn.rb b/lib/discourse_webauthn.rb
index 7756495ec2e..b6857f68315 100644
--- a/lib/discourse_webauthn.rb
+++ b/lib/discourse_webauthn.rb
@@ -14,32 +14,46 @@ module DiscourseWebauthn
class InvalidOriginError < SecurityKeyError
end
+
class InvalidRelyingPartyIdError < SecurityKeyError
end
+
class UserVerificationError < SecurityKeyError
end
+
class UserPresenceError < SecurityKeyError
end
+
class ChallengeMismatchError < SecurityKeyError
end
+
class InvalidTypeError < SecurityKeyError
end
+
class UnsupportedPublicKeyAlgorithmError < SecurityKeyError
end
+
class UnsupportedAttestationFormatError < SecurityKeyError
end
+
class CredentialIdInUseError < SecurityKeyError
end
+
class MalformedAttestationError < SecurityKeyError
end
+
class KeyNotFoundError < SecurityKeyError
end
+
class MalformedPublicKeyCredentialError < SecurityKeyError
end
+
class OwnershipError < SecurityKeyError
end
+
class PublicKeyError < SecurityKeyError
end
+
class UnknownCOSEAlgorithmError < SecurityKeyError
end
diff --git a/lib/email/receiver.rb b/lib/email/receiver.rb
index 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 < StandardError
end
+
class EmptyEmailError < ProcessingError
end
+
class ScreenedEmailError < ProcessingError
end
+
class UserNotFoundError < ProcessingError
end
+
class AutoGeneratedEmailError < ProcessingError
end
+
class BouncedEmailError < ProcessingError
end
+
class NoBodyDetectedError < ProcessingError
end
+
class NoSenderDetectedError < ProcessingError
end
+
class FromReplyByAddressError < ProcessingError
end
+
class InactiveUserError < ProcessingError
end
+
class SilencedUserError < ProcessingError
end
+
class BadDestinationAddress < ProcessingError
end
+
class StrangersNotAllowedError < ProcessingError
end
+
class ReplyNotAllowedError < ProcessingError
end
+
class InsufficientTrustLevelError < ProcessingError
end
+
class ReplyUserNotMatchingError < ProcessingError
end
+
class TopicNotFoundError < ProcessingError
end
+
class TopicClosedError < ProcessingError
end
+
class InvalidPost < ProcessingError
end
+
class TooShortPost < ProcessingError
end
+
class InvalidPostAction < ProcessingError
end
+
class UnsubscribeNotAllowed < ProcessingError
end
+
class EmailNotAllowed < ProcessingError
end
+
class OldDestinationError < ProcessingError
end
+
class ReplyToDigestError < ProcessingError
end
diff --git a/lib/final_destination.rb b/lib/final_destination.rb
index 0c107af9503..a67a0810774 100644
--- a/lib/final_destination.rb
+++ b/lib/final_destination.rb
@@ -10,6 +10,7 @@ require "url_helper"
class FinalDestination
class SSRFError < SocketError
end
+
class UrlEncodingError < ArgumentError
end
diff --git a/lib/final_destination/ssrf_detector.rb b/lib/final_destination/ssrf_detector.rb
index dcb20644f73..b3da5d07db3 100644
--- a/lib/final_destination/ssrf_detector.rb
+++ b/lib/final_destination/ssrf_detector.rb
@@ -4,6 +4,7 @@ class FinalDestination
module SSRFDetector
class DisallowedIpError < SSRFError
end
+
class LookupFailedError < SSRFError
end
diff --git a/lib/guardian.rb b/lib/guardian.rb
index a069ad8867a..d5e5b8243ac 100644
--- a/lib/guardian.rb
+++ b/lib/guardian.rb
@@ -28,51 +28,67 @@ class Guardian
def blank?
true
end
+
def admin?
false
end
+
def staff?
false
end
+
def moderator?
false
end
+
def anonymous?
true
end
+
def approved?
false
end
+
def staged?
false
end
+
def silenced?
false
end
+
def is_system_user?
false
end
+
def bot?
false
end
+
def secure_category_ids
[]
end
+
def groups
[]
end
+
def has_trust_level?(level)
false
end
+
def has_trust_level_or_staff?(level)
false
end
+
def email
nil
end
+
def whisperer?
false
end
+
def in_any_groups?(group_ids)
false
end
diff --git a/lib/import/normalize.rb b/lib/import/normalize.rb
index 8b9b98b8e06..71649eb059a 100644
--- a/lib/import/normalize.rb
+++ b/lib/import/normalize.rb
@@ -6,6 +6,7 @@
require "htmlentities"
module Import
end
+
module Import::Normalize
def self.normalize_code_blocks(code, lang = nil)
coder = HTMLEntities.new
diff --git a/lib/migration/safe_migrate.rb b/lib/migration/safe_migrate.rb
index b43bc38b029..def669ff037 100644
--- a/lib/migration/safe_migrate.rb
+++ b/lib/migration/safe_migrate.rb
@@ -56,6 +56,7 @@ class Migration::SafeMigrate
def e.cause
nil
end
+
def e.backtrace
super.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.rb
index 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::Connection
def before_committed!(*)
end
+
def rolledback!(*)
end
+
def trigger_transactional_callbacks?
true
end
diff --git a/lib/presence_channel.rb b/lib/presence_channel.rb
index 6e54b422b58..3e4854cd964 100644
--- a/lib/presence_channel.rb
+++ b/lib/presence_channel.rb
@@ -5,10 +5,13 @@
class PresenceChannel
class NotFound < StandardError
end
+
class InvalidAccess < StandardError
end
+
class ConfigNotLoaded < StandardError
end
+
class InvalidConfig < StandardError
end
diff --git a/plugins/chat/lib/chat/message_mover.rb b/plugins/chat/lib/chat/message_mover.rb
index 93747a26cdb..ae5e8c4be96 100644
--- a/plugins/chat/lib/chat/message_mover.rb
+++ b/plugins/chat/lib/chat/message_mover.rb
@@ -32,6 +32,7 @@ module Chat
class MessageMover
class NoMessagesFound < StandardError
end
+
class InvalidChannel < StandardError
end
diff --git a/script/import_scripts/phpbb3/support/bbcode/markdown_node.rb b/script/import_scripts/phpbb3/support/bbcode/markdown_node.rb
index 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 ImportScripts
end
+
module ImportScripts::PhpBB3
end
diff --git a/script/import_scripts/smf2.rb b/script/import_scripts/smf2.rb
index defa13292f6..b8d697b2b3a 100644
--- a/script/import_scripts/smf2.rb
+++ b/script/import_scripts/smf2.rb
@@ -585,6 +585,7 @@ class ImportScripts::Smf2 < ImportScripts::Base
class Options
class Error < StandardError
end
+
class SettingsError < Error
end
diff --git a/script/thread_detective.rb b/script/thread_detective.rb
index 83e886d085c..d72fd5e8ae2 100644
--- a/script/thread_detective.rb
+++ b/script/thread_detective.rb
@@ -8,6 +8,7 @@ class ThreadDetective
def self.test_thread
Thread.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.rb
index 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 do
def name
"myauth"
end
+
def can_connect_existing_user?
false
end
@@ -164,6 +165,7 @@ RSpec.describe Auth::ManagedAuthenticator do
def name
"myauth"
end
+
def match_by_email
false
end
@@ -328,9 +330,11 @@ RSpec.describe Auth::ManagedAuthenticator do
def name
"myauth"
end
+
def match_by_email
false
end
+
def match_by_username
true
end
@@ -395,6 +399,7 @@ RSpec.describe Auth::ManagedAuthenticator do
def name
"myauth"
end
+
def match_by_username
false
end
diff --git a/spec/lib/plugin/instance_spec.rb b/spec/lib/plugin/instance_spec.rb
index 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"
end
end
+
class TroutJuniorSerializer < TroutSerializer
attribute :i_am_child
diff --git a/spec/lib/site_setting_extension_spec.rb b/spec/lib/site_setting_extension_spec.rb
index 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 do
def self.valid_value?(v)
true
end
+
def self.values
[1, 2, 3]
end
@@ -409,9 +410,11 @@ RSpec.describe SiteSettingExtension do
def self.valid_value?(v)
self.values.include?(v)
end
+
def self.values
["en"]
end
+
def self.translate_names?
false
end
diff --git a/spec/lib/site_settings/type_supervisor_spec.rb b/spec/lib/site_settings/type_supervisor_spec.rb
index 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 do
def self.valid_value?(v)
self.values.include?(v)
end
+
def self.values
["en"]
end
+
def self.translate_names?
false
end
@@ -147,9 +149,11 @@ RSpec.describe SiteSettings::TypeSupervisor do
class TestSmallThanTenValidator
def initialize(opts)
end
+
def valid_value?(v)
v < 10
end
+
def error_message
""
end
@@ -408,9 +412,11 @@ RSpec.describe SiteSettings::TypeSupervisor do
def self.valid_value?(v)
self.values.include?(v)
end
+
def self.values
%w[a b]
end
+
def self.translate_names?
false
end
diff --git a/spec/support/imap_helper.rb b/spec/support/imap_helper.rb
index 8476192ef8e..88f71875f3c 100644
--- a/spec/support/imap_helper.rb
+++ b/spec/support/imap_helper.rb
@@ -3,8 +3,10 @@
class MockedImapProvider < Imap::Providers::Gmail
def connect!
end
+
def disconnect!
end
+
def open_mailbox(mailbox_name, write: false)
end
diff --git a/spec/system/page_objects/admin_user_badges.rb b/spec/system/page_objects/admin_user_badges.rb
index 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 PageObjects
def user_badges_table
page.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}" })
end
diff --git a/spec/system/page_objects/modals/badge.rb b/spec/system/page_objects/modals/badge.rb
index c0af307772f..48ea9e8b0cd 100644
--- a/spec/system/page_objects/modals/badge.rb
+++ b/spec/system/page_objects/modals/badge.rb
@@ -8,6 +8,7 @@ module PageObjects
def modal
find(".grant-badge-modal")
end
+
def select_badge(badge_name)
within(modal) do
grantable_badges_dropdown.expand
diff --git a/spec/system/page_objects/modals/change_owner.rb b/spec/system/page_objects/modals/change_owner.rb
index 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 PageObjects
def modal
find(".change-ownership-modal")
end
+
def select_new_owner(user)
within(modal) do
users_dropdown.expand