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

@ -6,7 +6,7 @@ RSpec.describe Admin::AccountModerationNotesHelper, type: :helper do
include AccountsHelper
describe '#admin_account_link_to' do
context 'account is nil' do
context 'when Account is nil' do
let(:account) { nil }
it 'returns nil' do
@ -30,7 +30,7 @@ RSpec.describe Admin::AccountModerationNotesHelper, type: :helper do
end
describe '#admin_account_inline_link_to' do
context 'account is nil' do
context 'when Account is nil' do
let(:account) { nil }
it 'returns nil' do

View file

@ -22,14 +22,14 @@ describe JsonLdHelper do
end
describe '#first_of_value' do
context 'value.is_a?(Array)' do
context 'when value.is_a?(Array)' do
it 'returns value.first' do
value = ['a']
expect(helper.first_of_value(value)).to be 'a'
end
end
context '!value.is_a?(Array)' do
context 'with !value.is_a?(Array)' do
it 'returns value' do
value = 'a'
expect(helper.first_of_value(value)).to be 'a'
@ -38,14 +38,14 @@ describe JsonLdHelper do
end
describe '#supported_context?' do
context "!json.nil? && equals_or_includes?(json['@context'], ActivityPub::TagManager::CONTEXT)" do
context 'when json is present and in an activitypub tagmanager context' do
it 'returns true' do
json = { '@context' => ActivityPub::TagManager::CONTEXT }.as_json
expect(helper.supported_context?(json)).to be true
end
end
context 'else' do
context 'when not in activitypub tagmanager context' do
it 'returns false' do
json = nil
expect(helper.supported_context?(json)).to be false
@ -90,7 +90,7 @@ describe JsonLdHelper do
end
end
context 'compaction and forwarding' do
context 'with compaction and forwarding' do
let(:json) do
{
'@context' => [

View file

@ -24,7 +24,7 @@ RSpec.describe RoutingHelper, type: :helper do
end
end
context 'Do not use S3' do
context 'when not using S3' do
before do
Rails.configuration.x.use_s3 = false
end
@ -32,7 +32,7 @@ RSpec.describe RoutingHelper, type: :helper do
it_behaves_like 'returns full path URL'
end
context 'Use S3' do
context 'when using S3' do
before do
Rails.configuration.x.use_s3 = true
end