mirror of
https://github.com/mastodon/mastodon.git
synced 2026-06-10 09:37:24 -05:00
Update rubocop-rspec to version 3.10.1 (#39303)
This commit is contained in:
parent
4ee21a6c14
commit
fc64804b4d
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user