Fix RSpec/DescribedClass
cop (#25104)
This commit is contained in:
parent
1e243e2df7
commit
c42591356d
66 changed files with 347 additions and 414 deletions
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::FetchRemoteAccountService, type: :service do
|
||||
subject { ActivityPub::FetchRemoteAccountService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:actor) do
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::FetchRemoteActorService, type: :service do
|
||||
subject { ActivityPub::FetchRemoteActorService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:actor) do
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::FetchRemoteKeyService, type: :service do
|
||||
subject { ActivityPub::FetchRemoteKeyService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:webfinger) { { subject: 'acct:alice@example.com', links: [{ rel: 'self', href: 'https://example.com/alice' }] } }
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe AfterBlockDomainFromAccountService, type: :service do
|
||||
subject { AfterBlockDomainFromAccountService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:wolf) { Fabricate(:account, username: 'wolf', domain: 'evil.org', inbox_url: 'https://evil.org/inbox', protocol: :activitypub) }
|
||||
let!(:alice) { Fabricate(:account, username: 'alice') }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe AuthorizeFollowService, type: :service do
|
||||
subject { AuthorizeFollowService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe BatchedRemoveStatusService, type: :service do
|
||||
subject { BatchedRemoveStatusService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:alice) { Fabricate(:account) }
|
||||
let!(:bob) { Fabricate(:account, username: 'bob', domain: 'example.com') }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe BlockDomainService, type: :service do
|
||||
subject { BlockDomainService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:bad_account) { Fabricate(:account, username: 'badguy666', domain: 'evil.org') }
|
||||
let!(:bad_status1) { Fabricate(:status, account: bad_account, text: 'You suck') }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe BlockService, type: :service do
|
||||
subject { BlockService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe BootstrapTimelineService, type: :service do
|
||||
subject { BootstrapTimelineService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
context 'when the new user has registered from an invite' do
|
||||
let(:service) { double }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ClearDomainMediaService, type: :service do
|
||||
subject { ClearDomainMediaService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:bad_account) { Fabricate(:account, username: 'badguy666', domain: 'evil.org') }
|
||||
let!(:bad_status1) { Fabricate(:status, account: bad_account, text: 'You suck') }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe FavouriteService, type: :service do
|
||||
subject { FavouriteService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe FollowService, type: :service do
|
||||
subject { FollowService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ RSpec.describe ImportService, type: :service do
|
|||
end
|
||||
|
||||
context 'when importing old-style list of muted users' do
|
||||
subject { ImportService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:csv) { attachment_fixture('mute-imports.txt') }
|
||||
|
||||
|
@ -52,7 +52,7 @@ RSpec.describe ImportService, type: :service do
|
|||
end
|
||||
|
||||
context 'when importing new-style list of muted users' do
|
||||
subject { ImportService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:csv) { attachment_fixture('new-mute-imports.txt') }
|
||||
|
||||
|
@ -93,7 +93,7 @@ RSpec.describe ImportService, type: :service do
|
|||
end
|
||||
|
||||
context 'when importing old-style list of followed users' do
|
||||
subject { ImportService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:csv) { attachment_fixture('mute-imports.txt') }
|
||||
|
||||
|
@ -135,7 +135,7 @@ RSpec.describe ImportService, type: :service do
|
|||
end
|
||||
|
||||
context 'when importing new-style list of followed users' do
|
||||
subject { ImportService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:csv) { attachment_fixture('new-following-imports.txt') }
|
||||
|
||||
|
@ -182,7 +182,7 @@ RSpec.describe ImportService, type: :service do
|
|||
#
|
||||
# https://github.com/mastodon/mastodon/issues/20571
|
||||
context 'with a utf-8 encoded domains' do
|
||||
subject { ImportService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:nare) { Fabricate(:account, username: 'nare', domain: 'թութ.հայ', locked: false, protocol: :activitypub, inbox_url: 'https://թութ.հայ/inbox') }
|
||||
let(:csv) { attachment_fixture('utf8-followers.txt') }
|
||||
|
@ -201,7 +201,7 @@ RSpec.describe ImportService, type: :service do
|
|||
end
|
||||
|
||||
context 'when importing bookmarks' do
|
||||
subject { ImportService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:csv) { attachment_fixture('bookmark-imports.txt') }
|
||||
let(:local_account) { Fabricate(:account, username: 'foo', domain: '') }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe PostStatusService, type: :service do
|
||||
subject { PostStatusService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
it 'creates a new status' do
|
||||
account = Fabricate(:account)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe PrecomputeFeedService, type: :service do
|
||||
subject { PrecomputeFeedService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
describe 'call' do
|
||||
let(:account) { Fabricate(:account) }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ProcessMentionsService, type: :service do
|
||||
subject { ProcessMentionsService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:account) { Fabricate(:account, username: 'alice') }
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe PurgeDomainService, type: :service do
|
||||
subject { PurgeDomainService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:old_account) { Fabricate(:account, domain: 'obsolete.org') }
|
||||
let!(:old_status1) { Fabricate(:status, account: old_account) }
|
||||
|
|
|
@ -6,7 +6,7 @@ RSpec.describe ReblogService, type: :service do
|
|||
let(:alice) { Fabricate(:account, username: 'alice') }
|
||||
|
||||
context 'when creates a reblog with appropriate visibility' do
|
||||
subject { ReblogService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:visibility) { :public }
|
||||
let(:reblog_visibility) { :public }
|
||||
|
@ -62,7 +62,7 @@ RSpec.describe ReblogService, type: :service do
|
|||
end
|
||||
|
||||
context 'with ActivityPub' do
|
||||
subject { ReblogService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:bob) { Fabricate(:account, username: 'bob', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox') }
|
||||
let(:status) { Fabricate(:status, account: bob) }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe RejectFollowService, type: :service do
|
||||
subject { RejectFollowService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe RemoveFromFollowersService, type: :service do
|
||||
subject { RemoveFromFollowersService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:bob) { Fabricate(:account, username: 'bob') }
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe RemoveStatusService, type: :service do
|
||||
subject { RemoveStatusService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:alice) { Fabricate(:account) }
|
||||
let!(:bob) { Fabricate(:account, username: 'bob', domain: 'example.com') }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe UnallowDomainService, type: :service do
|
||||
subject { UnallowDomainService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:bad_account) { Fabricate(:account, username: 'badguy666', domain: 'evil.org') }
|
||||
let!(:bad_status1) { Fabricate(:status, account: bad_account, text: 'You suck') }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe UnblockService, type: :service do
|
||||
subject { UnblockService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe UnfollowService, type: :service do
|
||||
subject { UnfollowService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe UnmuteService, type: :service do
|
||||
subject { UnmuteService.new }
|
||||
subject { described_class.new }
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe UpdateAccountService, type: :service do
|
||||
subject { UpdateAccountService.new }
|
||||
subject { described_class.new }
|
||||
|
||||
describe 'switching form locked to unlocked accounts' do
|
||||
let(:account) { Fabricate(:account, locked: true) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue