0
0
Fork 0

Fix RSpec/ContextWording cop (#24739)

This commit is contained in:
Matt Jankowski 2023-05-03 23:49:08 -04:00 committed by GitHub
parent cf18cc2891
commit 710745e16b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
105 changed files with 559 additions and 668 deletions

View file

@ -226,12 +226,12 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
end
end
context 'statuses referencing other statuses' do
context 'with statuses referencing other statuses' do
before do
stub_const 'ActivityPub::FetchRemoteStatusService::DISCOVERIES_PER_REQUEST', 5
end
context 'using inReplyTo' do
context 'when using inReplyTo' do
let(:object) do
{
'@context': 'https://www.w3.org/ns/activitystreams',
@ -267,7 +267,7 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
end
end
context 'using replies' do
context 'when using replies' do
let(:object) do
{
'@context': 'https://www.w3.org/ns/activitystreams',

View file

@ -5,7 +5,7 @@ require 'rails_helper'
RSpec.describe ActivityPub::ProcessAccountService, type: :service do
subject { described_class.new }
context 'property values' do
context 'with property values' do
let(:payload) do
{
id: 'https://foo.test',
@ -82,7 +82,7 @@ RSpec.describe ActivityPub::ProcessAccountService, type: :service do
account.suspend!(origin: suspension_origin)
end
context 'locally' do
context 'when locally' do
let(:suspension_origin) { :local }
it 'does not unsuspend it' do
@ -94,7 +94,7 @@ RSpec.describe ActivityPub::ProcessAccountService, type: :service do
end
end
context 'remotely' do
context 'when remotely' do
let(:suspension_origin) { :remote }
it 'unsuspends it' do
@ -112,7 +112,7 @@ RSpec.describe ActivityPub::ProcessAccountService, type: :service do
end
end
context 'discovering many subdomains in a short timeframe' do
context 'when discovering many subdomains in a short timeframe' do
before do
stub_const 'ActivityPub::ProcessAccountService::SUBDOMAINS_RATELIMIT', 5
end
@ -138,7 +138,7 @@ RSpec.describe ActivityPub::ProcessAccountService, type: :service do
end
end
context 'accounts referencing other accounts' do
context 'when Accounts referencing other accounts' do
before do
stub_const 'ActivityPub::ProcessAccountService::DISCOVERIES_PER_REQUEST', 5
end

View file

@ -269,7 +269,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
end
end
context 'originally without tags' do
context 'when originally without tags' do
before do
subject.call(status, json)
end
@ -279,7 +279,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
end
end
context 'originally with tags' do
context 'when originally with tags' do
let(:tags) { [Fabricate(:tag, name: 'test'), Fabricate(:tag, name: 'foo')] }
let(:payload) do
@ -305,7 +305,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
end
end
context 'originally without mentions' do
context 'when originally without mentions' do
before do
subject.call(status, json)
end
@ -315,7 +315,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
end
end
context 'originally with mentions' do
context 'when originally with mentions' do
let(:mentions) { [alice, bob] }
before do
@ -327,7 +327,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
end
end
context 'originally without media attachments' do
context 'when originally without media attachments' do
before do
stub_request(:get, 'https://example.com/foo.png').to_return(body: attachment_fixture('emojo.png'))
subject.call(status, json)
@ -362,7 +362,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
end
end
context 'originally with media attachments' do
context 'when originally with media attachments' do
let(:media_attachments) { [Fabricate(:media_attachment, remote_url: 'https://example.com/foo.png'), Fabricate(:media_attachment, remote_url: 'https://example.com/unused.png')] }
let(:payload) do
@ -404,7 +404,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
end
end
context 'originally with a poll' do
context 'when originally with a poll' do
before do
poll = Fabricate(:poll, status: status)
status.update(preloadable_poll: poll)
@ -420,7 +420,7 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService, type: :service do
end
end
context 'originally without a poll' do
context 'when originally without a poll' do
let(:payload) do
{
'@context': 'https://www.w3.org/ns/activitystreams',