Merge remote-tracking branch 'parent/main' into upstream-20240906
This commit is contained in:
commit
218cb37fe3
176 changed files with 750 additions and 603 deletions
|
@ -30,7 +30,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
it 'returns an empty list' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to be_empty
|
||||
expect(response.parsed_body).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -73,7 +73,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
it 'returns the expected domain blocks' do
|
||||
subject
|
||||
|
||||
expect(body_as_json).to match_array(expected_responde)
|
||||
expect(response.parsed_body).to match_array(expected_responde)
|
||||
end
|
||||
|
||||
context 'with limit param' do
|
||||
|
@ -82,7 +82,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
it 'returns only the requested number of domain blocks' do
|
||||
subject
|
||||
|
||||
expect(body_as_json.size).to eq(params[:limit])
|
||||
expect(response.parsed_body.size).to eq(params[:limit])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -126,28 +126,26 @@ RSpec.describe 'Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to match(
|
||||
{
|
||||
id: domain_block.id.to_s,
|
||||
domain: domain_block.domain,
|
||||
digest: domain_block.domain_digest,
|
||||
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,
|
||||
block_trends: domain_block.block_trends,
|
||||
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_exclude_followers: domain_block.reject_reply_exclude_followers,
|
||||
reject_send_sensitive: domain_block.reject_send_sensitive,
|
||||
reject_straight_follow: domain_block.reject_straight_follow,
|
||||
reject_friend: domain_block.reject_friend,
|
||||
}
|
||||
expect(response.parsed_body).to match(
|
||||
id: domain_block.id.to_s,
|
||||
domain: domain_block.domain,
|
||||
digest: domain_block.domain_digest,
|
||||
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,
|
||||
block_trends: domain_block.block_trends,
|
||||
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_exclude_followers: domain_block.reject_reply_exclude_followers,
|
||||
reject_send_sensitive: domain_block.reject_send_sensitive,
|
||||
reject_straight_follow: domain_block.reject_straight_follow,
|
||||
reject_friend: domain_block.reject_friend
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -175,7 +173,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to match a_hash_including(
|
||||
expect(response.parsed_body).to match a_hash_including(
|
||||
{
|
||||
domain: 'foo.bar.com',
|
||||
severity: 'silence',
|
||||
|
@ -196,7 +194,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to match a_hash_including(
|
||||
expect(response.parsed_body).to match a_hash_including(
|
||||
{
|
||||
domain: 'foo.bar.com',
|
||||
severity: 'suspend',
|
||||
|
@ -216,7 +214,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(422)
|
||||
expect(body_as_json[:existing_domain_block][:domain]).to eq('foo.bar.com')
|
||||
expect(response.parsed_body[:existing_domain_block][:domain]).to eq('foo.bar.com')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -229,7 +227,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(422)
|
||||
expect(body_as_json[:existing_domain_block][:domain]).to eq('bar.com')
|
||||
expect(response.parsed_body[:existing_domain_block][:domain]).to eq('bar.com')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -260,7 +258,7 @@ RSpec.describe 'Domain Blocks' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json).to match a_hash_including(
|
||||
expect(response.parsed_body).to match a_hash_including(
|
||||
{
|
||||
id: domain_block.id.to_s,
|
||||
domain: domain_block.domain,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue