* Fix: #374 拡張ドメインブロックのインポート・エクスポートについてkmyblue独自の項目が反映されない問題 * Fix test
This commit is contained in:
parent
64a149b338
commit
4e1e675939
5 changed files with 70 additions and 10 deletions
|
@ -22,6 +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: 'no.op', severity: 'noop', public_comment: 'noop')
|
||||
|
||||
get :export, params: { format: :csv }
|
||||
|
@ -43,7 +44,16 @@ RSpec.describe Admin::ExportDomainBlocksController do
|
|||
end
|
||||
|
||||
it 'renders page with expected domain blocks' do
|
||||
expect(assigns(:domain_blocks).map { |block| [block.domain, block.severity.to_sym] }).to contain_exactly(['bad.domain', :silence], ['worse.domain', :suspend], ['reject.media', :noop])
|
||||
expect(assigns(:domain_blocks).map { |block| [block.domain, block.severity.to_sym] }).to contain_exactly(['bad.domain', :silence], ['worse.domain', :suspend], ['reject.media', :noop], ['little.spam', :noop])
|
||||
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]
|
||||
)
|
||||
end
|
||||
|
||||
it 'returns http success' do
|
||||
|
|
9
spec/fixtures/files/domain_blocks.csv
vendored
9
spec/fixtures/files/domain_blocks.csv
vendored
|
@ -1,4 +1,5 @@
|
|||
#domain,#severity,#reject_media,#reject_reports,#public_comment,#obfuscate
|
||||
bad.domain,silence,false,false,bad server,false
|
||||
worse.domain,suspend,true,true,worse server,true
|
||||
reject.media,noop,true,false,reject media and test unicode characters ♥,false
|
||||
#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
|
||||
|
|
|
|
@ -291,7 +291,7 @@ RSpec.describe Form::Import do
|
|||
it_behaves_like 'on successful import', 'blocking', 'merge', 'imports.txt', (%w(user@example.com user@test.com).map { |acct| { 'acct' => acct } })
|
||||
it_behaves_like 'on successful import', 'blocking', 'overwrite', 'imports.txt', (%w(user@example.com user@test.com).map { |acct| { 'acct' => acct } })
|
||||
it_behaves_like 'on successful import', 'muting', 'merge', 'imports.txt', (%w(user@example.com user@test.com).map { |acct| { 'acct' => acct } })
|
||||
it_behaves_like 'on successful import', 'domain_blocking', 'merge', 'domain_blocks.csv', (%w(bad.domain worse.domain reject.media).map { |domain| { 'domain' => domain } })
|
||||
it_behaves_like 'on successful import', 'domain_blocking', 'merge', 'domain_blocks.csv', (%w(bad.domain worse.domain reject.media little.spam).map { |domain| { 'domain' => domain } })
|
||||
it_behaves_like 'on successful import', 'bookmarks', 'merge', 'bookmark-imports.txt', (%w(https://example.com/statuses/1312 https://local.com/users/foo/statuses/42 https://unknown-remote.com/users/bar/statuses/1 https://example.com/statuses/direct).map { |uri| { 'uri' => uri } })
|
||||
|
||||
it_behaves_like 'on successful import', 'following', 'merge', 'following_accounts.csv', [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue