mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-18 23:49:42 +00:00
Remove unneeded type: :service
from spec/services files (#29304)
This commit is contained in:
parent
3eaac3af73
commit
469028b6d3
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
describe AccountSearchService, type: :service do
|
||||
describe AccountSearchService do
|
||||
describe '#call' do
|
||||
context 'with a query to ignore' do
|
||||
it 'returns empty array for missing query' do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
describe AccountStatusesCleanupService, type: :service do
|
||||
describe AccountStatusesCleanupService do
|
||||
let(:account) { Fabricate(:account, username: 'alice', domain: nil) }
|
||||
let(:account_policy) { Fabricate(:account_statuses_cleanup_policy, account: account) }
|
||||
let!(:unrelated_status) { Fabricate(:status, created_at: 3.years.ago) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::FetchFeaturedCollectionService, type: :service do
|
||||
RSpec.describe ActivityPub::FetchFeaturedCollectionService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'https://example.com/account', featured_collection_url: 'https://example.com/account/pinned') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::FetchFeaturedTagsCollectionService, type: :service do
|
||||
RSpec.describe ActivityPub::FetchFeaturedTagsCollectionService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:collection_url) { 'https://example.com/account/tags' }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::FetchRemoteAccountService, type: :service do
|
||||
RSpec.describe ActivityPub::FetchRemoteAccountService do
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:actor) do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::FetchRemoteActorService, type: :service do
|
||||
RSpec.describe ActivityPub::FetchRemoteActorService do
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:actor) do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::FetchRemoteKeyService, type: :service do
|
||||
RSpec.describe ActivityPub::FetchRemoteKeyService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:webfinger) { { subject: 'acct:alice@example.com', links: [{ rel: 'self', href: 'https://example.com/alice' }] } }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
|
||||
RSpec.describe ActivityPub::FetchRemoteStatusService do
|
||||
include ActionView::Helpers::TextHelper
|
||||
|
||||
subject { described_class.new }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::FetchRepliesService, type: :service do
|
||||
RSpec.describe ActivityPub::FetchRepliesService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/account') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::ProcessAccountService, type: :service do
|
||||
RSpec.describe ActivityPub::ProcessAccountService do
|
||||
subject { described_class.new }
|
||||
|
||||
context 'with property values, an avatar, and a profile header' do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::ProcessCollectionService, type: :service do
|
||||
RSpec.describe ActivityPub::ProcessCollectionService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/account') }
|
||||
|
|
|
@ -6,7 +6,7 @@ def poll_option_json(name, votes)
|
|||
{ type: 'Note', name: name, replies: { type: 'Collection', totalItems: votes } }
|
||||
end
|
||||
|
||||
RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
|
||||
RSpec.describe ActivityPub::ProcessStatusUpdateService do
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:status) { Fabricate(:status, text: 'Hello world', account: Fabricate(:account, domain: 'example.com')) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ActivityPub::SynchronizeFollowersService, type: :service do
|
||||
RSpec.describe ActivityPub::SynchronizeFollowersService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/account', inbox_url: 'http://example.com/inbox') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe AfterBlockDomainFromAccountService, type: :service do
|
||||
RSpec.describe AfterBlockDomainFromAccountService do
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:wolf) { Fabricate(:account, username: 'wolf', domain: 'evil.org', inbox_url: 'https://evil.org/inbox', protocol: :activitypub) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe AfterBlockService, type: :service do
|
||||
RSpec.describe AfterBlockService do
|
||||
subject { described_class.new.call(account, target_account) }
|
||||
|
||||
let(:account) { Fabricate(:account) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe AppSignUpService, type: :service do
|
||||
RSpec.describe AppSignUpService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:app) { Fabricate(:application, scopes: 'read write') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe AuthorizeFollowService, type: :service do
|
||||
RSpec.describe AuthorizeFollowService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe BackupService, type: :service do
|
||||
RSpec.describe BackupService do
|
||||
subject(:service_call) { described_class.new.call(backup) }
|
||||
|
||||
let!(:user) { Fabricate(:user) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe BatchedRemoveStatusService, :sidekiq_inline, type: :service do
|
||||
RSpec.describe BatchedRemoveStatusService, :sidekiq_inline do
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:alice) { Fabricate(:account) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe BlockDomainService, type: :service do
|
||||
RSpec.describe BlockDomainService do
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:bad_account) { Fabricate(:account, username: 'badguy666', domain: 'evil.org') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe BlockService, type: :service do
|
||||
RSpec.describe BlockService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe BootstrapTimelineService, type: :service do
|
||||
RSpec.describe BootstrapTimelineService do
|
||||
subject { described_class.new }
|
||||
|
||||
context 'when the new user has registered from an invite' do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ClearDomainMediaService, type: :service do
|
||||
RSpec.describe ClearDomainMediaService do
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:bad_account) { Fabricate(:account, username: 'badguy666', domain: 'evil.org') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe DeleteAccountService, type: :service do
|
||||
RSpec.describe DeleteAccountService do
|
||||
shared_examples 'common behavior' do
|
||||
subject { described_class.new.call(account) }
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe FanOutOnWriteService, type: :service do
|
||||
RSpec.describe FanOutOnWriteService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:last_active_at) { Time.now.utc }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe FavouriteService, type: :service do
|
||||
RSpec.describe FavouriteService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe FetchLinkCardService, type: :service do
|
||||
RSpec.describe FetchLinkCardService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:html) { '<!doctype html><title>Hello world</title>' }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
describe FetchOEmbedService, type: :service do
|
||||
describe FetchOEmbedService do
|
||||
subject { described_class.new }
|
||||
|
||||
before do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe FetchRemoteStatusService, type: :service do
|
||||
RSpec.describe FetchRemoteStatusService do
|
||||
let(:account) { Fabricate(:account, domain: 'example.org', uri: 'https://example.org/foo') }
|
||||
let(:prefetched_body) { nil }
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe FetchResourceService, type: :service do
|
||||
RSpec.describe FetchResourceService do
|
||||
describe '#call' do
|
||||
subject { described_class.new.call(url) }
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe FollowService, type: :service do
|
||||
RSpec.describe FollowService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ImportService, :sidekiq_inline, type: :service do
|
||||
RSpec.describe ImportService, :sidekiq_inline do
|
||||
include RoutingHelper
|
||||
|
||||
let!(:account) { Fabricate(:account, locked: false) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe MuteService, type: :service do
|
||||
RSpec.describe MuteService do
|
||||
subject { described_class.new.call(account, target_account) }
|
||||
|
||||
let(:account) { Fabricate(:account) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe NotifyService, type: :service do
|
||||
RSpec.describe NotifyService do
|
||||
subject { described_class.new.call(recipient, type, activity) }
|
||||
|
||||
let(:user) { Fabricate(:user) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe PostStatusService, type: :service do
|
||||
RSpec.describe PostStatusService do
|
||||
subject { described_class.new }
|
||||
|
||||
it 'creates a new status' do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe PrecomputeFeedService, type: :service do
|
||||
RSpec.describe PrecomputeFeedService do
|
||||
subject { described_class.new }
|
||||
|
||||
describe 'call' do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ProcessMentionsService, type: :service do
|
||||
RSpec.describe ProcessMentionsService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:account) { Fabricate(:account, username: 'alice') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe PurgeDomainService, type: :service do
|
||||
RSpec.describe PurgeDomainService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:domain) { 'obsolete.org' }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ReblogService, type: :service do
|
||||
RSpec.describe ReblogService do
|
||||
let(:alice) { Fabricate(:account, username: 'alice') }
|
||||
|
||||
context 'when creates a reblog with appropriate visibility' do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe RejectFollowService, type: :service do
|
||||
RSpec.describe RejectFollowService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe RemoveFromFollowersService, type: :service do
|
||||
RSpec.describe RemoveFromFollowersService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:bob) { Fabricate(:account, username: 'bob') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe RemoveStatusService, :sidekiq_inline, type: :service do
|
||||
RSpec.describe RemoveStatusService, :sidekiq_inline do
|
||||
subject { described_class.new }
|
||||
|
||||
let!(:alice) { Fabricate(:account) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ReportService, type: :service do
|
||||
RSpec.describe ReportService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:source_account) { Fabricate(:account) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ResolveAccountService, type: :service do
|
||||
RSpec.describe ResolveAccountService do
|
||||
subject { described_class.new }
|
||||
|
||||
before do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
describe ResolveURLService, type: :service do
|
||||
describe ResolveURLService do
|
||||
subject { described_class.new }
|
||||
|
||||
describe '#call' do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
describe SearchService, type: :service do
|
||||
describe SearchService do
|
||||
subject { described_class.new }
|
||||
|
||||
describe '#call' do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe SoftwareUpdateCheckService, type: :service do
|
||||
RSpec.describe SoftwareUpdateCheckService do
|
||||
subject { described_class.new }
|
||||
|
||||
shared_examples 'when the feature is enabled' do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe SuspendAccountService, :sidekiq_inline, type: :service do
|
||||
RSpec.describe SuspendAccountService, :sidekiq_inline do
|
||||
shared_examples 'common behavior' do
|
||||
subject { described_class.new.call(account) }
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe TranslateStatusService, type: :service do
|
||||
RSpec.describe TranslateStatusService do
|
||||
subject(:service) { described_class.new }
|
||||
|
||||
let(:status) { Fabricate(:status, text: text, spoiler_text: spoiler_text, language: 'en', preloadable_poll: poll, media_attachments: media_attachments) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe UnallowDomainService, type: :service do
|
||||
RSpec.describe UnallowDomainService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:bad_domain) { 'evil.org' }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
describe UnblockDomainService, type: :service do
|
||||
describe UnblockDomainService do
|
||||
subject { described_class.new }
|
||||
|
||||
describe 'call' do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe UnblockService, type: :service do
|
||||
RSpec.describe UnblockService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe UnfollowService, type: :service do
|
||||
RSpec.describe UnfollowService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:sender) { Fabricate(:account, username: 'alice') }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe UnsuspendAccountService, type: :service do
|
||||
RSpec.describe UnsuspendAccountService do
|
||||
shared_context 'with common context' do
|
||||
subject { described_class.new.call(account) }
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe UpdateAccountService, type: :service do
|
||||
RSpec.describe UpdateAccountService do
|
||||
subject { described_class.new }
|
||||
|
||||
describe 'switching form locked to unlocked accounts', :sidekiq_inline do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe UpdateStatusService, type: :service do
|
||||
RSpec.describe UpdateStatusService do
|
||||
subject { described_class.new }
|
||||
|
||||
context 'when nothing changes' do
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe VerifyLinkService, type: :service do
|
||||
RSpec.describe VerifyLinkService do
|
||||
subject { described_class.new }
|
||||
|
||||
context 'when given a local account' do
|
||||
|
|
Loading…
Reference in a new issue