From 440b80b2e795c21a22de4514160679e68561d98b Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 1 Dec 2023 06:00:41 -0500 Subject: [PATCH] Model concerns organization into module namespaces (#28149) --- .rubocop_todo.yml | 18 ++++++------- app/models/account.rb | 25 ++++++++++--------- .../associations.rb} | 2 +- .../{account_avatar.rb => account/avatar.rb} | 2 +- .../counters.rb} | 2 +- .../finder_concern.rb} | 2 +- .../{account_header.rb => account/header.rb} | 2 +- .../interactions.rb} | 2 +- .../merging.rb} | 2 +- .../{account_search.rb => account/search.rb} | 2 +- .../statuses_search.rb} | 2 +- .../safe_reblog_insert.rb} | 2 +- .../search_concern.rb} | 2 +- .../snapshot_concern.rb} | 2 +- .../threading_concern.rb} | 2 +- .../has_settings.rb} | 2 +- .../concerns/{ => user}/ldap_authenticable.rb | 2 +- .../concerns/{ => user}/omniauthable.rb | 2 +- .../concerns/{ => user}/pam_authenticable.rb | 2 +- app/models/status.rb | 10 ++++---- app/models/user.rb | 11 ++++---- app/views/settings/profiles/show.html.haml | 4 +-- lib/mastodon/cli/maintenance.rb | 4 +-- spec/models/account_spec.rb | 4 +-- .../counters_spec.rb} | 2 +- .../finder_concern_spec.rb} | 2 +- .../interactions_spec.rb} | 2 +- .../statuses_search_spec.rb} | 2 +- .../threading_concern_spec.rb} | 2 +- .../search_spec.rb} | 2 +- .../statuses_search_spec.rb} | 2 +- 31 files changed, 62 insertions(+), 62 deletions(-) rename app/models/concerns/{account_associations.rb => account/associations.rb} (99%) rename app/models/concerns/{account_avatar.rb => account/avatar.rb} (98%) rename app/models/concerns/{account_counters.rb => account/counters.rb} (99%) rename app/models/concerns/{account_finder_concern.rb => account/finder_concern.rb} (98%) rename app/models/concerns/{account_header.rb => account/header.rb} (98%) rename app/models/concerns/{account_interactions.rb => account/interactions.rb} (99%) rename app/models/concerns/{account_merging.rb => account/merging.rb} (98%) rename app/models/concerns/{account_search.rb => account/search.rb} (99%) rename app/models/concerns/{account_statuses_search.rb => account/statuses_search.rb} (97%) rename app/models/concerns/{status_safe_reblog_insert.rb => status/safe_reblog_insert.rb} (98%) rename app/models/concerns/{status_search_concern.rb => status/search_concern.rb} (97%) rename app/models/concerns/{status_snapshot_concern.rb => status/snapshot_concern.rb} (96%) rename app/models/concerns/{status_threading_concern.rb => status/threading_concern.rb} (98%) rename app/models/concerns/{has_user_settings.rb => user/has_settings.rb} (99%) rename app/models/concerns/{ => user}/ldap_authenticable.rb (98%) rename app/models/concerns/{ => user}/omniauthable.rb (99%) rename app/models/concerns/{ => user}/pam_authenticable.rb (98%) rename spec/models/concerns/{account_counters_spec.rb => account/counters_spec.rb} (98%) rename spec/models/concerns/{account_finder_concern_spec.rb => account/finder_concern_spec.rb} (98%) rename spec/models/concerns/{account_interactions_spec.rb => account/interactions_spec.rb} (99%) rename spec/models/concerns/{account_statuses_search_spec.rb => account/statuses_search_spec.rb} (98%) rename spec/models/concerns/{status_threading_concern_spec.rb => status/threading_concern_spec.rb} (99%) rename spec/search/models/concerns/{account_search_spec.rb => account/search_spec.rb} (98%) rename spec/search/models/concerns/{account_statuses_search_spec.rb => account/statuses_search_spec.rb} (98%) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index dbd5beac2e..9fb163ceb9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -107,7 +107,7 @@ Rails/ApplicationController: # Include: app/models/**/*.rb Rails/HasAndBelongsToMany: Exclude: - - 'app/models/concerns/account_associations.rb' + - 'app/models/concerns/account/associations.rb' - 'app/models/preview_card.rb' - 'app/models/status.rb' - 'app/models/tag.rb' @@ -116,7 +116,7 @@ Rails/HasAndBelongsToMany: # Include: app/models/**/*.rb Rails/HasManyOrHasOneDependent: Exclude: - - 'app/models/concerns/account_counters.rb' + - 'app/models/concerns/account/counters.rb' - 'app/models/conversation.rb' - 'app/models/custom_emoji.rb' - 'app/models/custom_emoji_category.rb' @@ -172,7 +172,7 @@ Rails/SkipsModelValidations: Exclude: - 'app/controllers/admin/invites_controller.rb' - 'app/controllers/concerns/session_tracking_concern.rb' - - 'app/models/concerns/account_merging.rb' + - 'app/models/concerns/account/merging.rb' - 'app/models/concerns/expireable.rb' - 'app/models/status.rb' - 'app/models/trends/links.rb' @@ -252,7 +252,7 @@ Rails/WhereExists: - 'app/lib/feed_manager.rb' - 'app/lib/status_cache_hydrator.rb' - 'app/lib/suspicious_sign_in_detector.rb' - - 'app/models/concerns/account_interactions.rb' + - 'app/models/concerns/account/interactions.rb' - 'app/models/featured_tag.rb' - 'app/models/poll.rb' - 'app/models/session_activation.rb' @@ -342,8 +342,8 @@ Style/GuardClause: - 'app/lib/request_pool.rb' - 'app/lib/webfinger.rb' - 'app/lib/webfinger_resource.rb' - - 'app/models/concerns/account_counters.rb' - - 'app/models/concerns/ldap_authenticable.rb' + - 'app/models/concerns/account/counters.rb' + - 'app/models/concerns/user/ldap_authenticable.rb' - 'app/models/tag.rb' - 'app/models/user.rb' - 'app/services/fan_out_on_write_service.rb' @@ -372,8 +372,8 @@ Style/HashAsLastArrayItem: Exclude: - 'app/controllers/admin/statuses_controller.rb' - 'app/controllers/api/v1/statuses_controller.rb' - - 'app/models/concerns/account_counters.rb' - - 'app/models/concerns/status_threading_concern.rb' + - 'app/models/concerns/account/counters.rb' + - 'app/models/concerns/status/threading_concern.rb' - 'app/models/status.rb' - 'app/services/batched_remove_status_service.rb' - 'app/services/notify_service.rb' @@ -486,7 +486,7 @@ Style/RedundantReturn: # AllowedMethods: present?, blank?, presence, try, try! Style/SafeNavigation: Exclude: - - 'app/models/concerns/account_finder_concern.rb' + - 'app/models/concerns/account/finder_concern.rb' # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. diff --git a/app/models/account.rb b/app/models/account.rb index 03edcb2a25..4119944e59 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -70,19 +70,20 @@ class Account < ApplicationRecord URL_PREFIX_RE = %r{\Ahttp(s?)://[^/]+} USERNAME_ONLY_RE = /\A#{USERNAME_RE}\z/i - include Attachmentable - include AccountAssociations - include AccountAvatar - include AccountFinderConcern - include AccountHeader - include AccountInteractions - include Paginable - include AccountCounters - include DomainNormalizable + include Attachmentable # Load prior to Avatar & Header concerns + + include Account::Associations + include Account::Avatar + include Account::Counters + include Account::FinderConcern + include Account::Header + include Account::Interactions + include Account::Merging + include Account::Search + include Account::StatusesSearch include DomainMaterializable - include AccountMerging - include AccountSearch - include AccountStatusesSearch + include DomainNormalizable + include Paginable enum protocol: { ostatus: 0, activitypub: 1 } enum suspension_origin: { local: 0, remote: 1 }, _prefix: true diff --git a/app/models/concerns/account_associations.rb b/app/models/concerns/account/associations.rb similarity index 99% rename from app/models/concerns/account_associations.rb rename to app/models/concerns/account/associations.rb index 592812e960..31902ae21a 100644 --- a/app/models/concerns/account_associations.rb +++ b/app/models/concerns/account/associations.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module AccountAssociations +module Account::Associations extend ActiveSupport::Concern included do diff --git a/app/models/concerns/account_avatar.rb b/app/models/concerns/account/avatar.rb similarity index 98% rename from app/models/concerns/account_avatar.rb rename to app/models/concerns/account/avatar.rb index b5919a9a23..39f599db18 100644 --- a/app/models/concerns/account_avatar.rb +++ b/app/models/concerns/account/avatar.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module AccountAvatar +module Account::Avatar extend ActiveSupport::Concern IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze diff --git a/app/models/concerns/account_counters.rb b/app/models/concerns/account/counters.rb similarity index 99% rename from app/models/concerns/account_counters.rb rename to app/models/concerns/account/counters.rb index 3fabb52054..fb69be9b70 100644 --- a/app/models/concerns/account_counters.rb +++ b/app/models/concerns/account/counters.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module AccountCounters +module Account::Counters extend ActiveSupport::Concern ALLOWED_COUNTER_KEYS = %i(statuses_count following_count followers_count).freeze diff --git a/app/models/concerns/account_finder_concern.rb b/app/models/concerns/account/finder_concern.rb similarity index 98% rename from app/models/concerns/account_finder_concern.rb rename to app/models/concerns/account/finder_concern.rb index 37c3b88959..7faaddeb43 100644 --- a/app/models/concerns/account_finder_concern.rb +++ b/app/models/concerns/account/finder_concern.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module AccountFinderConcern +module Account::FinderConcern extend ActiveSupport::Concern class_methods do diff --git a/app/models/concerns/account_header.rb b/app/models/concerns/account/header.rb similarity index 98% rename from app/models/concerns/account_header.rb rename to app/models/concerns/account/header.rb index e184880f93..44ae774e94 100644 --- a/app/models/concerns/account_header.rb +++ b/app/models/concerns/account/header.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module AccountHeader +module Account::Header extend ActiveSupport::Concern IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze diff --git a/app/models/concerns/account_interactions.rb b/app/models/concerns/account/interactions.rb similarity index 99% rename from app/models/concerns/account_interactions.rb rename to app/models/concerns/account/interactions.rb index 3c64ebd9fa..0ea26e628d 100644 --- a/app/models/concerns/account_interactions.rb +++ b/app/models/concerns/account/interactions.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module AccountInteractions +module Account::Interactions extend ActiveSupport::Concern class_methods do diff --git a/app/models/concerns/account_merging.rb b/app/models/concerns/account/merging.rb similarity index 98% rename from app/models/concerns/account_merging.rb rename to app/models/concerns/account/merging.rb index 14e157a3d8..960ee1819f 100644 --- a/app/models/concerns/account_merging.rb +++ b/app/models/concerns/account/merging.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module AccountMerging +module Account::Merging extend ActiveSupport::Concern def merge_with!(other_account) diff --git a/app/models/concerns/account_search.rb b/app/models/concerns/account/search.rb similarity index 99% rename from app/models/concerns/account_search.rb rename to app/models/concerns/account/search.rb index b855727b4d..b02b9bd461 100644 --- a/app/models/concerns/account_search.rb +++ b/app/models/concerns/account/search.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module AccountSearch +module Account::Search extend ActiveSupport::Concern DISALLOWED_TSQUERY_CHARACTERS = /['?\\:‘’]/ diff --git a/app/models/concerns/account_statuses_search.rb b/app/models/concerns/account/statuses_search.rb similarity index 97% rename from app/models/concerns/account_statuses_search.rb rename to app/models/concerns/account/statuses_search.rb index 4b2bc4117a..334b714504 100644 --- a/app/models/concerns/account_statuses_search.rb +++ b/app/models/concerns/account/statuses_search.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module AccountStatusesSearch +module Account::StatusesSearch extend ActiveSupport::Concern included do diff --git a/app/models/concerns/status_safe_reblog_insert.rb b/app/models/concerns/status/safe_reblog_insert.rb similarity index 98% rename from app/models/concerns/status_safe_reblog_insert.rb rename to app/models/concerns/status/safe_reblog_insert.rb index 0007b46d40..60ddb78e52 100644 --- a/app/models/concerns/status_safe_reblog_insert.rb +++ b/app/models/concerns/status/safe_reblog_insert.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module StatusSafeReblogInsert +module Status::SafeReblogInsert extend ActiveSupport::Concern class_methods do diff --git a/app/models/concerns/status_search_concern.rb b/app/models/concerns/status/search_concern.rb similarity index 97% rename from app/models/concerns/status_search_concern.rb rename to app/models/concerns/status/search_concern.rb index 7252fde737..c16db8bd8c 100644 --- a/app/models/concerns/status_search_concern.rb +++ b/app/models/concerns/status/search_concern.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module StatusSearchConcern +module Status::SearchConcern extend ActiveSupport::Concern included do diff --git a/app/models/concerns/status_snapshot_concern.rb b/app/models/concerns/status/snapshot_concern.rb similarity index 96% rename from app/models/concerns/status_snapshot_concern.rb rename to app/models/concerns/status/snapshot_concern.rb index 9741b9aeb2..ba624d943e 100644 --- a/app/models/concerns/status_snapshot_concern.rb +++ b/app/models/concerns/status/snapshot_concern.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module StatusSnapshotConcern +module Status::SnapshotConcern extend ActiveSupport::Concern included do diff --git a/app/models/concerns/status_threading_concern.rb b/app/models/concerns/status/threading_concern.rb similarity index 98% rename from app/models/concerns/status_threading_concern.rb rename to app/models/concerns/status/threading_concern.rb index 2ca3b66c27..2606fd2f27 100644 --- a/app/models/concerns/status_threading_concern.rb +++ b/app/models/concerns/status/threading_concern.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module StatusThreadingConcern +module Status::ThreadingConcern extend ActiveSupport::Concern def ancestors(limit, account = nil) diff --git a/app/models/concerns/has_user_settings.rb b/app/models/concerns/user/has_settings.rb similarity index 99% rename from app/models/concerns/has_user_settings.rb rename to app/models/concerns/user/has_settings.rb index b7c7104a13..bfa8aa2ca3 100644 --- a/app/models/concerns/has_user_settings.rb +++ b/app/models/concerns/user/has_settings.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module HasUserSettings +module User::HasSettings extend ActiveSupport::Concern included do diff --git a/app/models/concerns/ldap_authenticable.rb b/app/models/concerns/user/ldap_authenticable.rb similarity index 98% rename from app/models/concerns/ldap_authenticable.rb rename to app/models/concerns/user/ldap_authenticable.rb index 775df08176..d84ff084b2 100644 --- a/app/models/concerns/ldap_authenticable.rb +++ b/app/models/concerns/user/ldap_authenticable.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module LdapAuthenticable +module User::LdapAuthenticable extend ActiveSupport::Concern class_methods do diff --git a/app/models/concerns/omniauthable.rb b/app/models/concerns/user/omniauthable.rb similarity index 99% rename from app/models/concerns/omniauthable.rb rename to app/models/concerns/user/omniauthable.rb index 3983fbcda8..6d1d1b8cc3 100644 --- a/app/models/concerns/omniauthable.rb +++ b/app/models/concerns/user/omniauthable.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Omniauthable +module User::Omniauthable extend ActiveSupport::Concern TEMP_EMAIL_PREFIX = 'change@me' diff --git a/app/models/concerns/pam_authenticable.rb b/app/models/concerns/user/pam_authenticable.rb similarity index 98% rename from app/models/concerns/pam_authenticable.rb rename to app/models/concerns/user/pam_authenticable.rb index f97f986a41..a682058cca 100644 --- a/app/models/concerns/pam_authenticable.rb +++ b/app/models/concerns/user/pam_authenticable.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module PamAuthenticable +module User::PamAuthenticable extend ActiveSupport::Concern included do diff --git a/app/models/status.rb b/app/models/status.rb index 41c8950296..7b1ca69c7c 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -30,14 +30,14 @@ # class Status < ApplicationRecord + include Cacheable include Discard::Model include Paginable - include Cacheable - include StatusThreadingConcern - include StatusSnapshotConcern include RateLimitable - include StatusSafeReblogInsert - include StatusSearchConcern + include Status::SafeReblogInsert + include Status::SearchConcern + include Status::SnapshotConcern + include Status::ThreadingConcern rate_limit by: :account, family: :statuses diff --git a/app/models/user.rb b/app/models/user.rb index b0eba97c36..550f8bfd30 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -53,9 +53,12 @@ class User < ApplicationRecord filtered_languages ) - include Redisable include LanguagesHelper - include HasUserSettings + include Redisable + include User::HasSettings + include User::LdapAuthenticable + include User::Omniauthable + include User::PamAuthenticable # The home and list feeds will be stored in Redis for this amount # of time, and status fan-out to followers will include only people @@ -75,10 +78,6 @@ class User < ApplicationRecord devise :registerable, :recoverable, :validatable, :confirmable - include Omniauthable - include PamAuthenticable - include LdapAuthenticable - belongs_to :account, inverse_of: :user belongs_to :invite, counter_cache: :uses, optional: true belongs_to :created_by_application, class_name: 'Doorkeeper::Application', optional: true diff --git a/app/views/settings/profiles/show.html.haml b/app/views/settings/profiles/show.html.haml index 7c13dc7f44..5f9613c939 100644 --- a/app/views/settings/profiles/show.html.haml +++ b/app/views/settings/profiles/show.html.haml @@ -33,7 +33,7 @@ .fields-row .fields-row__column.fields-row__column-6 .fields-group - = f.input :avatar, wrapper: :with_block_label, input_html: { accept: AccountAvatar::IMAGE_MIME_TYPES.join(',') }, hint: t('simple_form.hints.defaults.avatar', dimensions: '400x400', size: number_to_human_size(AccountAvatar::LIMIT)) + = f.input :avatar, wrapper: :with_block_label, input_html: { accept: Account::Avatar::IMAGE_MIME_TYPES.join(',') }, hint: t('simple_form.hints.defaults.avatar', dimensions: '400x400', size: number_to_human_size(Account::Avatar::LIMIT)) .fields-row__column.fields-row__column-6 .fields-group @@ -46,7 +46,7 @@ .fields-row .fields-row__column.fields-row__column-6 .fields-group - = f.input :header, wrapper: :with_block_label, input_html: { accept: AccountHeader::IMAGE_MIME_TYPES.join(',') }, hint: t('simple_form.hints.defaults.header', dimensions: '1500x500', size: number_to_human_size(AccountHeader::LIMIT)) + = f.input :header, wrapper: :with_block_label, input_html: { accept: Account::Header::IMAGE_MIME_TYPES.join(',') }, hint: t('simple_form.hints.defaults.header', dimensions: '1500x500', size: number_to_human_size(Account::Header::LIMIT)) .fields-row__column.fields-row__column-6 .fields-group diff --git a/lib/mastodon/cli/maintenance.rb b/lib/mastodon/cli/maintenance.rb index a95b7a30cd..c53d742548 100644 --- a/lib/mastodon/cli/maintenance.rb +++ b/lib/mastodon/cli/maintenance.rb @@ -67,8 +67,8 @@ module Mastodon::CLI local? ? username : "#{username}@#{domain}" end - # This is a duplicate of the AccountMerging concern because we need it to - # be independent from code version. + # This is a duplicate of the Account::Merging concern because we need it + # to be independent from code version. def merge_with!(other_account) # Since it's the same remote resource, the remote resource likely # already believes we are following/blocking, so it's safe to diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index 9652ea1910..522549125f 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -451,7 +451,7 @@ RSpec.describe Account do end it 'limits via constant by default' do - stub_const('AccountSearch::DEFAULT_LIMIT', 1) + stub_const('Account::Search::DEFAULT_LIMIT', 1) 2.times.each { Fabricate(:account, display_name: 'Display Name') } results = described_class.search_for('display') expect(results.size).to eq 1 @@ -595,7 +595,7 @@ RSpec.describe Account do end it 'limits by 10 by default' do - stub_const('AccountSearch::DEFAULT_LIMIT', 1) + stub_const('Account::Search::DEFAULT_LIMIT', 1) 2.times { Fabricate(:account, display_name: 'Display Name') } results = described_class.advanced_search_for('display', account) expect(results.size).to eq 1 diff --git a/spec/models/concerns/account_counters_spec.rb b/spec/models/concerns/account/counters_spec.rb similarity index 98% rename from spec/models/concerns/account_counters_spec.rb rename to spec/models/concerns/account/counters_spec.rb index fb02d79f11..2e1cd700bc 100644 --- a/spec/models/concerns/account_counters_spec.rb +++ b/spec/models/concerns/account/counters_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe AccountCounters do +describe Account::Counters do let!(:account) { Fabricate(:account) } describe '#increment_count!' do diff --git a/spec/models/concerns/account_finder_concern_spec.rb b/spec/models/concerns/account/finder_concern_spec.rb similarity index 98% rename from spec/models/concerns/account_finder_concern_spec.rb rename to spec/models/concerns/account/finder_concern_spec.rb index 3a94c4d545..ab5149e987 100644 --- a/spec/models/concerns/account_finder_concern_spec.rb +++ b/spec/models/concerns/account/finder_concern_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe AccountFinderConcern do +describe Account::FinderConcern do describe 'local finders' do let!(:account) { Fabricate(:account, username: 'Alice') } diff --git a/spec/models/concerns/account_interactions_spec.rb b/spec/models/concerns/account/interactions_spec.rb similarity index 99% rename from spec/models/concerns/account_interactions_spec.rb rename to spec/models/concerns/account/interactions_spec.rb index 6687c84436..6fac41e071 100644 --- a/spec/models/concerns/account_interactions_spec.rb +++ b/spec/models/concerns/account/interactions_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe AccountInteractions do +describe Account::Interactions do let(:account) { Fabricate(:account, username: 'account') } let(:account_id) { account.id } let(:account_ids) { [account_id] } diff --git a/spec/models/concerns/account_statuses_search_spec.rb b/spec/models/concerns/account/statuses_search_spec.rb similarity index 98% rename from spec/models/concerns/account_statuses_search_spec.rb rename to spec/models/concerns/account/statuses_search_spec.rb index 46362936f4..ab249d62d0 100644 --- a/spec/models/concerns/account_statuses_search_spec.rb +++ b/spec/models/concerns/account/statuses_search_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe AccountStatusesSearch do +describe Account::StatusesSearch do let(:account) { Fabricate(:account, indexable: indexable) } before do diff --git a/spec/models/concerns/status_threading_concern_spec.rb b/spec/models/concerns/status/threading_concern_spec.rb similarity index 99% rename from spec/models/concerns/status_threading_concern_spec.rb rename to spec/models/concerns/status/threading_concern_spec.rb index 2eac1ca6e5..09fb218566 100644 --- a/spec/models/concerns/status_threading_concern_spec.rb +++ b/spec/models/concerns/status/threading_concern_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe StatusThreadingConcern do +describe Status::ThreadingConcern do describe '#ancestors' do let!(:alice) { Fabricate(:account, username: 'alice') } let!(:bob) { Fabricate(:account, username: 'bob', domain: 'example.com') } diff --git a/spec/search/models/concerns/account_search_spec.rb b/spec/search/models/concerns/account/search_spec.rb similarity index 98% rename from spec/search/models/concerns/account_search_spec.rb rename to spec/search/models/concerns/account/search_spec.rb index 65e1e4de1c..d8d7f355dd 100644 --- a/spec/search/models/concerns/account_search_spec.rb +++ b/spec/search/models/concerns/account/search_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe AccountSearch do +describe Account::Search do describe 'a non-discoverable account becoming discoverable' do let(:account) { Account.find_by(username: 'search_test_account_1') } diff --git a/spec/search/models/concerns/account_statuses_search_spec.rb b/spec/search/models/concerns/account/statuses_search_spec.rb similarity index 98% rename from spec/search/models/concerns/account_statuses_search_spec.rb rename to spec/search/models/concerns/account/statuses_search_spec.rb index d35cfa5639..bf2606eece 100644 --- a/spec/search/models/concerns/account_statuses_search_spec.rb +++ b/spec/search/models/concerns/account/statuses_search_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -describe AccountStatusesSearch do +describe Account::StatusesSearch do describe 'a non-indexable account becoming indexable' do let(:account) { Account.find_by(username: 'search_test_account_1') }