parent
dc3aabb4f4
commit
76b24193c4
18 changed files with 31 additions and 82 deletions
|
@ -22,7 +22,7 @@ RSpec.describe Admin::ExportDomainBlocksController do
|
|||
Fabricate(:domain_block, domain: 'bad.domain', severity: 'silence', public_comment: 'bad server')
|
||||
Fabricate(:domain_block, domain: 'worse.domain', severity: 'suspend', reject_media: true, reject_reports: true, public_comment: 'worse server', obfuscate: true)
|
||||
Fabricate(:domain_block, domain: 'reject.media', severity: 'noop', reject_media: true, public_comment: 'reject media and test unicode characters ♥')
|
||||
Fabricate(:domain_block, domain: 'little.spam', severity: 'noop', public_comment: 'has some spams', reject_favourite: true, reject_reply: true, reject_straight_follow: true)
|
||||
Fabricate(:domain_block, domain: 'little.spam', severity: 'noop', public_comment: 'has some spams', reject_favourite: true, reject_straight_follow: true)
|
||||
Fabricate(:domain_block, domain: 'no.op', severity: 'noop', public_comment: 'noop')
|
||||
|
||||
get :export, params: { format: :csv }
|
||||
|
@ -48,11 +48,11 @@ RSpec.describe Admin::ExportDomainBlocksController do
|
|||
end
|
||||
|
||||
it 'renders page with extended domain blocks' do
|
||||
expect(assigns(:domain_blocks).map { |block| [block.domain, block.reject_favourite, block.reject_reply, block.reject_friend] }).to contain_exactly(
|
||||
['bad.domain', false, false, false],
|
||||
['worse.domain', false, false, false],
|
||||
['reject.media', false, false, false],
|
||||
['little.spam', true, true, false]
|
||||
expect(assigns(:domain_blocks).map { |block| [block.domain, block.reject_favourite, block.reject_friend] }).to contain_exactly(
|
||||
['bad.domain', false, false],
|
||||
['worse.domain', false, false],
|
||||
['reject.media', false, false],
|
||||
['little.spam', true, false]
|
||||
)
|
||||
end
|
||||
|
||||
|
|
10
spec/fixtures/files/domain_blocks.csv
vendored
10
spec/fixtures/files/domain_blocks.csv
vendored
|
@ -1,5 +1,5 @@
|
|||
#domain,#severity,#reject_media,#reject_reports,#public_comment,#obfuscate,#reject_favourite,#reject_reply,#reject_send_sensitive,#reject_hashtag,#reject_straight_follow,#reject_new_follow,#hidden,#detect_invalid_subscription,#reject_reply_exclude_followers,#reject_friend,#block_trends
|
||||
bad.domain,silence,false,false,bad server,false,false,false,false,false,false,false,false,false,false,false,false
|
||||
worse.domain,suspend,true,true,worse server,true,false,false,false,false,false,false,false,false,false,false,false
|
||||
reject.media,noop,true,false,reject media and test unicode characters ♥,false,false,false,false,false,false,false,false,false,false,false,false
|
||||
little.spam,noop,false,false,has some spams,false,true,true,false,false,true,false,false,false,false,false,false
|
||||
#domain,#severity,#reject_media,#reject_reports,#public_comment,#obfuscate,#reject_favourite,#reject_send_sensitive,#reject_hashtag,#reject_straight_follow,#reject_new_follow,#hidden,#detect_invalid_subscription,#reject_reply_exclude_followers,#reject_friend,#block_trends
|
||||
bad.domain,silence,false,false,bad server,false,false,false,false,false,false,false,false,false,false,false
|
||||
worse.domain,suspend,true,true,worse server,true,false,false,false,false,false,false,false,false,false,false
|
||||
reject.media,noop,true,false,reject media and test unicode characters ♥,false,false,false,false,false,false,false,false,false,false,false
|
||||
little.spam,noop,false,false,has some spams,false,true,false,false,true,false,false,false,false,false,false
|
||||
|
|
|
|
@ -869,36 +869,6 @@ RSpec.describe ActivityPub::Activity::Create do
|
|||
end
|
||||
end
|
||||
|
||||
context 'with mentions domain block reject_reply' do
|
||||
before do
|
||||
Fabricate(:domain_block, domain: 'example.com', severity: :noop, reject_reply: true)
|
||||
subject.perform
|
||||
end
|
||||
|
||||
let(:custom_before) { true }
|
||||
let(:recipient) { Fabricate(:account) }
|
||||
|
||||
let(:object_json) do
|
||||
{
|
||||
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join,
|
||||
type: 'Note',
|
||||
content: 'Lorem ipsum',
|
||||
tag: [
|
||||
{
|
||||
type: 'Mention',
|
||||
href: ActivityPub::TagManager.instance.uri_for(recipient),
|
||||
},
|
||||
],
|
||||
}
|
||||
end
|
||||
|
||||
it 'creates status' do
|
||||
status = sender.statuses.first
|
||||
|
||||
expect(status).to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
context 'with mentions domain block reject_reply_exclude_followers' do
|
||||
before do
|
||||
Fabricate(:domain_block, domain: 'example.com', severity: :noop, reject_reply_exclude_followers: true)
|
||||
|
|
|
@ -62,7 +62,6 @@ RSpec.describe 'Domain Blocks' do
|
|||
reject_hashtag: domain_block.reject_hashtag,
|
||||
detect_invalid_subscription: domain_block.detect_invalid_subscription,
|
||||
reject_new_follow: domain_block.reject_new_follow,
|
||||
reject_reply: domain_block.reject_reply,
|
||||
reject_reply_exclude_followers: domain_block.reject_reply_exclude_followers,
|
||||
reject_send_sensitive: domain_block.reject_send_sensitive,
|
||||
reject_straight_follow: domain_block.reject_straight_follow,
|
||||
|
@ -112,7 +111,6 @@ RSpec.describe 'Domain Blocks' do
|
|||
reject_hashtag: domain_block.reject_hashtag,
|
||||
detect_invalid_subscription: domain_block.detect_invalid_subscription,
|
||||
reject_new_follow: domain_block.reject_new_follow,
|
||||
reject_reply: domain_block.reject_reply,
|
||||
reject_reply_exclude_followers: domain_block.reject_reply_exclude_followers,
|
||||
reject_send_sensitive: domain_block.reject_send_sensitive,
|
||||
reject_straight_follow: domain_block.reject_straight_follow,
|
||||
|
@ -145,7 +143,6 @@ RSpec.describe 'Domain Blocks' do
|
|||
reject_hashtag: domain_block.reject_hashtag,
|
||||
detect_invalid_subscription: domain_block.detect_invalid_subscription,
|
||||
reject_new_follow: domain_block.reject_new_follow,
|
||||
reject_reply: domain_block.reject_reply,
|
||||
reject_reply_exclude_followers: domain_block.reject_reply_exclude_followers,
|
||||
reject_send_sensitive: domain_block.reject_send_sensitive,
|
||||
reject_straight_follow: domain_block.reject_straight_follow,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue