Add stricter protocol fields validation for accounts (#25937)
This commit is contained in:
parent
1cceb62afd
commit
1e3b19230a
19 changed files with 96 additions and 49 deletions
|
@ -6,7 +6,7 @@ describe ActivityPub::DistributePollUpdateWorker do
|
|||
subject { described_class.new }
|
||||
|
||||
let(:account) { Fabricate(:account) }
|
||||
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com') }
|
||||
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com', domain: 'example.com') }
|
||||
let(:poll) { Fabricate(:poll, account: account) }
|
||||
let!(:status) { Fabricate(:status, account: account, poll: poll) }
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ describe ActivityPub::DistributionWorker do
|
|||
subject { described_class.new }
|
||||
|
||||
let(:status) { Fabricate(:status) }
|
||||
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com') }
|
||||
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com', domain: 'example.com') }
|
||||
|
||||
describe '#perform' do
|
||||
before do
|
||||
|
@ -36,7 +36,7 @@ describe ActivityPub::DistributionWorker do
|
|||
end
|
||||
|
||||
context 'with direct status' do
|
||||
let(:mentioned_account) { Fabricate(:account, protocol: :activitypub, inbox_url: 'https://foo.bar/inbox') }
|
||||
let(:mentioned_account) { Fabricate(:account, protocol: :activitypub, inbox_url: 'https://foo.bar/inbox', domain: 'foo.bar') }
|
||||
|
||||
before do
|
||||
status.update(visibility: :direct)
|
||||
|
|
|
@ -5,7 +5,7 @@ require 'rails_helper'
|
|||
describe ActivityPub::FetchRepliesWorker do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:account) { Fabricate(:account, uri: 'https://example.com/user/1') }
|
||||
let(:account) { Fabricate(:account, domain: 'example.com') }
|
||||
let(:status) { Fabricate(:status, account: account) }
|
||||
|
||||
let(:payload) do
|
||||
|
|
|
@ -6,8 +6,8 @@ describe ActivityPub::MoveDistributionWorker do
|
|||
subject { described_class.new }
|
||||
|
||||
let(:migration) { Fabricate(:account_migration) }
|
||||
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com') }
|
||||
let(:blocker) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example2.com') }
|
||||
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com', domain: 'example.com') }
|
||||
let(:blocker) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example2.com', domain: 'example2.com') }
|
||||
|
||||
describe '#perform' do
|
||||
before do
|
||||
|
|
|
@ -6,7 +6,7 @@ describe ActivityPub::StatusUpdateDistributionWorker do
|
|||
subject { described_class.new }
|
||||
|
||||
let(:status) { Fabricate(:status, text: 'foo') }
|
||||
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com') }
|
||||
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com', domain: 'example.com') }
|
||||
|
||||
describe '#perform' do
|
||||
before do
|
||||
|
|
|
@ -6,7 +6,7 @@ describe ActivityPub::UpdateDistributionWorker do
|
|||
subject { described_class.new }
|
||||
|
||||
let(:account) { Fabricate(:account) }
|
||||
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com') }
|
||||
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com', domain: 'example.com') }
|
||||
|
||||
describe '#perform' do
|
||||
before do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue