|
|
@ -47,7 +47,7 @@ RSpec.describe BulkImportService do
|
|
|
|
it 'requests to follow all the listed users once the workers have run' do
|
|
|
|
it 'requests to follow all the listed users once the workers have run' do
|
|
|
|
subject.call(import)
|
|
|
|
subject.call(import)
|
|
|
|
|
|
|
|
|
|
|
|
resolve_account_service_double = double
|
|
|
|
resolve_account_service_double = instance_double(ResolveAccountService)
|
|
|
|
allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service_double)
|
|
|
|
allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service_double)
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('user@foo.bar', any_args) { Fabricate(:account, username: 'user', domain: 'foo.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('user@foo.bar', any_args) { Fabricate(:account, username: 'user', domain: 'foo.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('unknown@unknown.bar', any_args) { Fabricate(:account, username: 'unknown', domain: 'unknown.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('unknown@unknown.bar', any_args) { Fabricate(:account, username: 'unknown', domain: 'unknown.bar', protocol: :activitypub) }
|
|
|
@ -95,7 +95,7 @@ RSpec.describe BulkImportService do
|
|
|
|
it 'requests to follow all the expected users once the workers have run' do
|
|
|
|
it 'requests to follow all the expected users once the workers have run' do
|
|
|
|
subject.call(import)
|
|
|
|
subject.call(import)
|
|
|
|
|
|
|
|
|
|
|
|
resolve_account_service_double = double
|
|
|
|
resolve_account_service_double = instance_double(ResolveAccountService)
|
|
|
|
allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service_double)
|
|
|
|
allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service_double)
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('user@foo.bar', any_args) { Fabricate(:account, username: 'user', domain: 'foo.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('user@foo.bar', any_args) { Fabricate(:account, username: 'user', domain: 'foo.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('unknown@unknown.bar', any_args) { Fabricate(:account, username: 'unknown', domain: 'unknown.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('unknown@unknown.bar', any_args) { Fabricate(:account, username: 'unknown', domain: 'unknown.bar', protocol: :activitypub) }
|
|
|
@ -133,7 +133,7 @@ RSpec.describe BulkImportService do
|
|
|
|
it 'blocks all the listed users once the workers have run' do
|
|
|
|
it 'blocks all the listed users once the workers have run' do
|
|
|
|
subject.call(import)
|
|
|
|
subject.call(import)
|
|
|
|
|
|
|
|
|
|
|
|
resolve_account_service_double = double
|
|
|
|
resolve_account_service_double = instance_double(ResolveAccountService)
|
|
|
|
allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service_double)
|
|
|
|
allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service_double)
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('user@foo.bar', any_args) { Fabricate(:account, username: 'user', domain: 'foo.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('user@foo.bar', any_args) { Fabricate(:account, username: 'user', domain: 'foo.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('unknown@unknown.bar', any_args) { Fabricate(:account, username: 'unknown', domain: 'unknown.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('unknown@unknown.bar', any_args) { Fabricate(:account, username: 'unknown', domain: 'unknown.bar', protocol: :activitypub) }
|
|
|
@ -177,7 +177,7 @@ RSpec.describe BulkImportService do
|
|
|
|
it 'requests to follow all the expected users once the workers have run' do
|
|
|
|
it 'requests to follow all the expected users once the workers have run' do
|
|
|
|
subject.call(import)
|
|
|
|
subject.call(import)
|
|
|
|
|
|
|
|
|
|
|
|
resolve_account_service_double = double
|
|
|
|
resolve_account_service_double = instance_double(ResolveAccountService)
|
|
|
|
allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service_double)
|
|
|
|
allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service_double)
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('user@foo.bar', any_args) { Fabricate(:account, username: 'user', domain: 'foo.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('user@foo.bar', any_args) { Fabricate(:account, username: 'user', domain: 'foo.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('unknown@unknown.bar', any_args) { Fabricate(:account, username: 'unknown', domain: 'unknown.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('unknown@unknown.bar', any_args) { Fabricate(:account, username: 'unknown', domain: 'unknown.bar', protocol: :activitypub) }
|
|
|
@ -215,7 +215,7 @@ RSpec.describe BulkImportService do
|
|
|
|
it 'mutes all the listed users once the workers have run' do
|
|
|
|
it 'mutes all the listed users once the workers have run' do
|
|
|
|
subject.call(import)
|
|
|
|
subject.call(import)
|
|
|
|
|
|
|
|
|
|
|
|
resolve_account_service_double = double
|
|
|
|
resolve_account_service_double = instance_double(ResolveAccountService)
|
|
|
|
allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service_double)
|
|
|
|
allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service_double)
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('user@foo.bar', any_args) { Fabricate(:account, username: 'user', domain: 'foo.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('user@foo.bar', any_args) { Fabricate(:account, username: 'user', domain: 'foo.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('unknown@unknown.bar', any_args) { Fabricate(:account, username: 'unknown', domain: 'unknown.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('unknown@unknown.bar', any_args) { Fabricate(:account, username: 'unknown', domain: 'unknown.bar', protocol: :activitypub) }
|
|
|
@ -263,7 +263,7 @@ RSpec.describe BulkImportService do
|
|
|
|
it 'requests to follow all the expected users once the workers have run' do
|
|
|
|
it 'requests to follow all the expected users once the workers have run' do
|
|
|
|
subject.call(import)
|
|
|
|
subject.call(import)
|
|
|
|
|
|
|
|
|
|
|
|
resolve_account_service_double = double
|
|
|
|
resolve_account_service_double = instance_double(ResolveAccountService)
|
|
|
|
allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service_double)
|
|
|
|
allow(ResolveAccountService).to receive(:new).and_return(resolve_account_service_double)
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('user@foo.bar', any_args) { Fabricate(:account, username: 'user', domain: 'foo.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('user@foo.bar', any_args) { Fabricate(:account, username: 'user', domain: 'foo.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('unknown@unknown.bar', any_args) { Fabricate(:account, username: 'unknown', domain: 'unknown.bar', protocol: :activitypub) }
|
|
|
|
allow(resolve_account_service_double).to receive(:call).with('unknown@unknown.bar', any_args) { Fabricate(:account, username: 'unknown', domain: 'unknown.bar', protocol: :activitypub) }
|
|
|
@ -360,7 +360,7 @@ RSpec.describe BulkImportService do
|
|
|
|
it 'updates the bookmarks as expected once the workers have run' do
|
|
|
|
it 'updates the bookmarks as expected once the workers have run' do
|
|
|
|
subject.call(import)
|
|
|
|
subject.call(import)
|
|
|
|
|
|
|
|
|
|
|
|
service_double = double
|
|
|
|
service_double = instance_double(ActivityPub::FetchRemoteStatusService)
|
|
|
|
allow(ActivityPub::FetchRemoteStatusService).to receive(:new).and_return(service_double)
|
|
|
|
allow(ActivityPub::FetchRemoteStatusService).to receive(:new).and_return(service_double)
|
|
|
|
allow(service_double).to receive(:call).with('https://domain.unknown/foo') { Fabricate(:status, uri: 'https://domain.unknown/foo') }
|
|
|
|
allow(service_double).to receive(:call).with('https://domain.unknown/foo') { Fabricate(:status, uri: 'https://domain.unknown/foo') }
|
|
|
|
allow(service_double).to receive(:call).with('https://domain.unknown/private') { Fabricate(:status, uri: 'https://domain.unknown/private', visibility: :direct) }
|
|
|
|
allow(service_double).to receive(:call).with('https://domain.unknown/private') { Fabricate(:status, uri: 'https://domain.unknown/private', visibility: :direct) }
|
|
|
@ -403,7 +403,7 @@ RSpec.describe BulkImportService do
|
|
|
|
it 'updates the bookmarks as expected once the workers have run' do
|
|
|
|
it 'updates the bookmarks as expected once the workers have run' do
|
|
|
|
subject.call(import)
|
|
|
|
subject.call(import)
|
|
|
|
|
|
|
|
|
|
|
|
service_double = double
|
|
|
|
service_double = instance_double(ActivityPub::FetchRemoteStatusService)
|
|
|
|
allow(ActivityPub::FetchRemoteStatusService).to receive(:new).and_return(service_double)
|
|
|
|
allow(ActivityPub::FetchRemoteStatusService).to receive(:new).and_return(service_double)
|
|
|
|
allow(service_double).to receive(:call).with('https://domain.unknown/foo') { Fabricate(:status, uri: 'https://domain.unknown/foo') }
|
|
|
|
allow(service_double).to receive(:call).with('https://domain.unknown/foo') { Fabricate(:status, uri: 'https://domain.unknown/foo') }
|
|
|
|
allow(service_double).to receive(:call).with('https://domain.unknown/private') { Fabricate(:status, uri: 'https://domain.unknown/private', visibility: :direct) }
|
|
|
|
allow(service_double).to receive(:call).with('https://domain.unknown/private') { Fabricate(:status, uri: 'https://domain.unknown/private', visibility: :direct) }
|
|
|
|