Update rubocop-rspec to version 3.10.1 (#39303)

This commit is contained in:
Matt Jankowski 2026-06-08 11:27:34 -04:00 committed by GitHub
parent 4ee21a6c14
commit fc64804b4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 24 additions and 22 deletions

View File

@ -778,15 +778,16 @@ GEM
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
rubocop-rails (2.35.3)
rubocop-rails (2.35.4)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-rspec (3.9.0)
rubocop-rspec (3.10.2)
lint_roller (~> 1.1)
rubocop (~> 1.81)
regexp_parser (>= 2.0)
rubocop (~> 1.86, >= 1.86.2)
rubocop-rspec_rails (2.32.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)

View File

@ -31,7 +31,7 @@ RSpec.describe WebAppControllerConcern do
expect(response)
.to have_http_status(:success)
expect(response.body)
.to match(/show/)
.to include('show')
end
end
@ -47,7 +47,7 @@ RSpec.describe WebAppControllerConcern do
expect(response)
.to have_http_status(:success)
expect(response.body)
.to match(/show/)
.to include('show')
end
end

View File

@ -10,12 +10,12 @@ RSpec.describe Admin::FilterHelper do
allow(helper).to receive_messages(params: params, url_for: '/test')
result = helper.filter_link_to('text', { resolved: true })
expect(result).to match(/text/)
expect(result).to include('text')
end
it 'Uses table_link_to to create icon links' do
result = helper.table_link_to 'icon', 'text', 'path'
expect(result).to match(/text/)
expect(result).to include('text')
end
end

View File

@ -16,8 +16,8 @@ RSpec.describe ApplicationHelper do
it 'uses the current theme and user settings classes in the result' do
expect(helper.html_classes)
.to match(/system-font/)
.and match(/reduce-motion/)
.to include('system-font')
.and include('reduce-motion')
end
private
@ -38,7 +38,7 @@ RSpec.describe ApplicationHelper do
helper.content_for(:body_classes) { 'admin' }
expect(helper.body_classes)
.to match(/admin/)
.to include('admin')
end
end
end

View File

@ -12,7 +12,7 @@ RSpec.describe ThemeHelper do
it 'returns the default stylesheet' do
expect(html_links.last.attributes.symbolize_keys)
.to include(
href: have_attributes(value: match(/default/))
href: have_attributes(value: include('default'))
)
end
end

View File

@ -26,7 +26,7 @@ RSpec.describe EmojiFormatter do
let(:text) { preformat_text(':coolcat: Beep boop') }
it 'converts the shortcode to an image tag' do
expect(subject).to match(/<img rel="emoji" draggable="false" width="16" height="16" class="emojione custom-emoji" alt=":coolcat:"/)
expect(subject).to include('<img rel="emoji" draggable="false" width="16" height="16" class="emojione custom-emoji" alt=":coolcat:"')
end
end
@ -34,7 +34,7 @@ RSpec.describe EmojiFormatter do
let(:text) { preformat_text('Beep :coolcat: boop') }
it 'converts the shortcode to an image tag' do
expect(subject).to match(/Beep <img rel="emoji" draggable="false" width="16" height="16" class="emojione custom-emoji" alt=":coolcat:"/)
expect(subject).to include('Beep <img rel="emoji" draggable="false" width="16" height="16" class="emojione custom-emoji" alt=":coolcat:"')
end
end
@ -42,7 +42,7 @@ RSpec.describe EmojiFormatter do
let(:text) { preformat_text(':coolcat::coolcat:') }
it 'does not touch the shortcodes' do
expect(subject).to match(/:coolcat::coolcat:/)
expect(subject).to include(':coolcat::coolcat:')
end
end
@ -50,7 +50,7 @@ RSpec.describe EmojiFormatter do
let(:text) { preformat_text('Beep boop :coolcat:') }
it 'converts the shortcode to an image tag' do
expect(subject).to match(/boop <img rel="emoji" draggable="false" width="16" height="16" class="emojione custom-emoji" alt=":coolcat:"/)
expect(subject).to include('boop <img rel="emoji" draggable="false" width="16" height="16" class="emojione custom-emoji" alt=":coolcat:"')
end
end
end

View File

@ -15,7 +15,7 @@ RSpec.describe 'I18n' do
it 'translates to `en` correctly and without error' do
expect { subject }.to_not raise_error
expect(subject).to match(/the error below/)
expect(subject).to include('the error below')
end
end
@ -28,7 +28,7 @@ RSpec.describe 'I18n' do
it 'translates to `my` correctly and without error' do
expect { subject }.to_not raise_error
expect(subject).to match(/1/)
expect(subject).to include('1')
end
end
end

View File

@ -375,7 +375,7 @@ RSpec.describe '/api/v1/statuses' do
.to start_with('application/json')
expect(response.parsed_body[:quote]).to be_present
expect(response.parsed_body[:spoiler_text]).to eq 'this is a CW'
expect(response.parsed_body[:content]).to match(/RE: /)
expect(response.parsed_body[:content]).to include('RE: ')
expect(response.headers['X-RateLimit-Limit']).to eq RateLimiter::FAMILIES[:statuses][:limit].to_s
expect(response.headers['X-RateLimit-Remaining']).to eq (RateLimiter::FAMILIES[:statuses][:limit] - 1).to_s
end

View File

@ -17,7 +17,7 @@ RSpec.describe 'Remote Interaction Helper' do
)
)
expect(response.body)
.to match(/remote_interaction_helper/)
.to include('remote_interaction_helper')
end
end

View File

@ -14,7 +14,7 @@ RSpec.describe REST::Admin::CohortSerializer do
'data' => be_a(Array).and(
all(include('date' => match_api_datetime_format))
),
'period' => match(/2024-01-01/).and(match_api_datetime_format)
'period' => include('2024-01-01').and(match_api_datetime_format)
)
end
end

View File

@ -23,13 +23,13 @@ RSpec.describe 'statuses/show.html.haml' do
expect(header_tags)
.to match(/<meta content=".+" property="og:title">/)
.and match(/<meta content="article" property="og:type">/)
.and include('<meta content="article" property="og:type">')
.and match(/<meta content=".+" property="og:image">/)
.and match(%r{<meta content="http://.+" property="og:url">})
expect(header_tags)
.to match(%r{<meta content="http://.+/media/.+/player" property="twitter:player">})
.and match(/<meta content="player" property="twitter:card">/)
.and include('<meta content="player" property="twitter:card">')
end
def header_tags

View File

@ -20,6 +20,7 @@ RSpec.describe Import::RowWorker do
shared_context 'when service errors' do
let(:service_double) { instance_double(BulkImportRowService) }
before { allow(service_double).to receive(:call).and_raise('dummy error') }
end