Fix: テスト
This commit is contained in:
parent
60195928e1
commit
f918a13c48
3 changed files with 18 additions and 30 deletions
|
@ -5,7 +5,7 @@ class REST::Admin::DomainBlockSerializer < ActiveModel::Serializer
|
||||||
:reject_media, :reject_favourite, :reject_reply, :reject_reports,
|
:reject_media, :reject_favourite, :reject_reply, :reject_reports,
|
||||||
:reject_send_not_public_searchability, :reject_reply_exclude_followers,
|
:reject_send_not_public_searchability, :reject_reply_exclude_followers,
|
||||||
:reject_send_public_unlisted, :reject_send_dissubscribable, :reject_send_media, :reject_send_sensitive,
|
:reject_send_public_unlisted, :reject_send_dissubscribable, :reject_send_media, :reject_send_sensitive,
|
||||||
:reject_hashtag, :reject_straight_follow, :reject_new_follow, :detect_invalid_subscription,
|
:reject_hashtag, :reject_straight_follow, :reject_new_follow, :reject_friend, :detect_invalid_subscription,
|
||||||
:private_comment, :public_comment, :obfuscate
|
:private_comment, :public_comment, :obfuscate
|
||||||
|
|
||||||
def id
|
def id
|
||||||
|
|
|
@ -45,22 +45,6 @@ RSpec.describe 'Domain Blocks' do
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
let(:expected_responde) do
|
let(:expected_responde) do
|
||||||
domain_blocks.map do |domain_block|
|
|
||||||
{
|
|
||||||
id: domain_block.id.to_s,
|
|
||||||
domain: domain_block.domain,
|
|
||||||
created_at: domain_block.created_at.strftime('%Y-%m-%dT%H:%M:%S.%LZ'),
|
|
||||||
severity: domain_block.severity.to_s,
|
|
||||||
reject_media: domain_block.reject_media,
|
|
||||||
reject_reports: domain_block.reject_reports,
|
|
||||||
private_comment: domain_block.private_comment,
|
|
||||||
public_comment: domain_block.public_comment,
|
|
||||||
obfuscate: domain_block.obfuscate,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
let(:expected_responde_with_kb_custom) do
|
|
||||||
domain_blocks.map do |domain_block|
|
domain_blocks.map do |domain_block|
|
||||||
{
|
{
|
||||||
id: domain_block.id.to_s,
|
id: domain_block.id.to_s,
|
||||||
|
@ -84,6 +68,7 @@ RSpec.describe 'Domain Blocks' do
|
||||||
reject_send_public_unlisted: domain_block.reject_send_public_unlisted,
|
reject_send_public_unlisted: domain_block.reject_send_public_unlisted,
|
||||||
reject_send_sensitive: domain_block.reject_send_sensitive,
|
reject_send_sensitive: domain_block.reject_send_sensitive,
|
||||||
reject_straight_follow: domain_block.reject_straight_follow,
|
reject_straight_follow: domain_block.reject_straight_follow,
|
||||||
|
reject_friend: domain_block.reject_friend,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -91,7 +76,7 @@ RSpec.describe 'Domain Blocks' do
|
||||||
it 'returns the expected domain blocks' do
|
it 'returns the expected domain blocks' do
|
||||||
subject
|
subject
|
||||||
|
|
||||||
expect(body_as_json).to match_array(expected_responde_with_kb_custom)
|
expect(body_as_json).to match_array(expected_responde)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with limit param' do
|
context 'with limit param' do
|
||||||
|
@ -136,6 +121,7 @@ RSpec.describe 'Domain Blocks' do
|
||||||
reject_send_public_unlisted: domain_block.reject_send_public_unlisted,
|
reject_send_public_unlisted: domain_block.reject_send_public_unlisted,
|
||||||
reject_send_sensitive: domain_block.reject_send_sensitive,
|
reject_send_sensitive: domain_block.reject_send_sensitive,
|
||||||
reject_straight_follow: domain_block.reject_straight_follow,
|
reject_straight_follow: domain_block.reject_straight_follow,
|
||||||
|
reject_friend: domain_block.reject_friend,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -143,7 +129,7 @@ RSpec.describe 'Domain Blocks' do
|
||||||
it_behaves_like 'forbidden for wrong role', ''
|
it_behaves_like 'forbidden for wrong role', ''
|
||||||
it_behaves_like 'forbidden for wrong role', 'Moderator'
|
it_behaves_like 'forbidden for wrong role', 'Moderator'
|
||||||
|
|
||||||
it 'returns the expected domain block content', :aggregate_failures do
|
it 'returns the expected domain block content', :aggregate_failures do # rubocop:disable RSpec/ExampleLength
|
||||||
subject
|
subject
|
||||||
|
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
|
@ -158,6 +144,19 @@ RSpec.describe 'Domain Blocks' do
|
||||||
private_comment: domain_block.private_comment,
|
private_comment: domain_block.private_comment,
|
||||||
public_comment: domain_block.public_comment,
|
public_comment: domain_block.public_comment,
|
||||||
obfuscate: domain_block.obfuscate,
|
obfuscate: domain_block.obfuscate,
|
||||||
|
reject_favourite: domain_block.reject_favourite,
|
||||||
|
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_dissubscribable: domain_block.reject_send_dissubscribable,
|
||||||
|
reject_send_media: domain_block.reject_send_media,
|
||||||
|
reject_send_not_public_searchability: domain_block.reject_send_not_public_searchability,
|
||||||
|
reject_send_public_unlisted: domain_block.reject_send_public_unlisted,
|
||||||
|
reject_send_sensitive: domain_block.reject_send_sensitive,
|
||||||
|
reject_straight_follow: domain_block.reject_straight_follow,
|
||||||
|
reject_friend: domain_block.reject_friend,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,17 +23,6 @@ RSpec.describe 'Lists' do
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:expected_response) do
|
let(:expected_response) do
|
||||||
lists.map do |list|
|
|
||||||
{
|
|
||||||
id: list.id.to_s,
|
|
||||||
title: list.title,
|
|
||||||
replies_policy: list.replies_policy,
|
|
||||||
exclusive: list.exclusive,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
let(:expected_response_with_antennas) do
|
|
||||||
lists.map do |list|
|
lists.map do |list|
|
||||||
{
|
{
|
||||||
id: list.id.to_s,
|
id: list.id.to_s,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue