独自機能の追加などで他の部分への影響が分かるようにCI周りの修正 (#1)

* Fix EmojiFormatter failure

* Add notification_emails.warning setting default value

* Fix list spec failure and add antennas for spec response

* Fix domain block spec failure to add kb custom response

* Fix SearchQueryTransformer spec failure

* Fix Account#matches_display_name spec failure

* Fix UpdateStatusService changes mentions spec failure

* Fix RuboCop Lint

* Ignore brakeman warning

* Fix CI failure for ignore brakeman warning

* Fix migration failure

* Fix README

* Fix migration CI failure

* Fix some spec failure

* Format code for RuboCop lint failure

* Fix ESlint failure

* Fix haml-lint failure
This commit is contained in:
S.H 2023-08-07 21:38:15 +09:00 committed by GitHub
parent b5949f8e48
commit 696e4a10d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 347 additions and 113 deletions

View file

@ -60,10 +60,38 @@ RSpec.describe 'Domain Blocks' do
end
end
let(:expected_responde_with_kb_custom) 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,
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,
}
end
end
it 'returns the expected domain blocks' do
subject
expect(body_as_json).to match_array(expected_responde)
expect(body_as_json).to match_array(expected_responde_with_kb_custom)
end
context 'with limit param' do
@ -85,6 +113,32 @@ RSpec.describe 'Domain Blocks' do
let!(:domain_block) { Fabricate(:domain_block) }
let(:expected_response) do
{
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,
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,
}
end
it_behaves_like 'forbidden for wrong scope', 'write:statuses'
it_behaves_like 'forbidden for wrong role', ''
it_behaves_like 'forbidden for wrong role', 'Moderator'
@ -98,19 +152,7 @@ RSpec.describe 'Domain Blocks' do
it 'returns the expected domain block content' do
subject
expect(body_as_json).to eq(
{
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,
}
)
expect(body_as_json).to eq(expected_response)
end
context 'when the requested domain block does not exist' do

View file

@ -33,6 +33,18 @@ RSpec.describe 'Lists' do
end
end
let(:expected_response_with_antennas) do
lists.map do |list|
{
id: list.id.to_s,
title: list.title,
replies_policy: list.replies_policy,
exclusive: list.exclusive,
antennas: list.antennas,
}
end
end
before do
Fabricate(:list)
end
@ -48,7 +60,7 @@ RSpec.describe 'Lists' do
it 'returns the expected lists' do
subject
expect(body_as_json).to match_array(expected_response)
expect(body_as_json).to match_array(expected_response_with_antennas)
end
end
@ -75,6 +87,7 @@ RSpec.describe 'Lists' do
title: list.title,
replies_policy: list.replies_policy,
exclusive: list.exclusive,
antennas: list.antennas,
})
end
@ -171,6 +184,7 @@ RSpec.describe 'Lists' do
title: list.title,
replies_policy: list.replies_policy,
exclusive: list.exclusive,
antennas: list.antennas,
})
end