diff --git a/Gemfile.lock b/Gemfile.lock
index dcbcb8d9b08..1ab5362854e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -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)
diff --git a/spec/controllers/concerns/web_app_controller_concern_spec.rb b/spec/controllers/concerns/web_app_controller_concern_spec.rb
index 2e7c20a0fe1..e526720facd 100644
--- a/spec/controllers/concerns/web_app_controller_concern_spec.rb
+++ b/spec/controllers/concerns/web_app_controller_concern_spec.rb
@@ -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
diff --git a/spec/helpers/admin/filter_helper_spec.rb b/spec/helpers/admin/filter_helper_spec.rb
index d07a6e1bb75..72cb8863c9f 100644
--- a/spec/helpers/admin/filter_helper_spec.rb
+++ b/spec/helpers/admin/filter_helper_spec.rb
@@ -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
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index 1b95be1d33c..cff79a7c73b 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -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
diff --git a/spec/helpers/theme_helper_spec.rb b/spec/helpers/theme_helper_spec.rb
index b6b50a7bfa5..28ae6fdddb7 100644
--- a/spec/helpers/theme_helper_spec.rb
+++ b/spec/helpers/theme_helper_spec.rb
@@ -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
diff --git a/spec/lib/emoji_formatter_spec.rb b/spec/lib/emoji_formatter_spec.rb
index e5accfbb0cb..e5a0efa20f2 100644
--- a/spec/lib/emoji_formatter_spec.rb
+++ b/spec/lib/emoji_formatter_spec.rb
@@ -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(/
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
diff --git a/spec/views/statuses/show.html.haml_spec.rb b/spec/views/statuses/show.html.haml_spec.rb
index 02b1fe73842..1b592320349 100644
--- a/spec/views/statuses/show.html.haml_spec.rb
+++ b/spec/views/statuses/show.html.haml_spec.rb
@@ -23,13 +23,13 @@ RSpec.describe 'statuses/show.html.haml' do
expect(header_tags)
.to match(//)
- .and match(//)
+ .and include('')
.and match(//)
.and match(%r{})
expect(header_tags)
.to match(%r{})
- .and match(//)
+ .and include('')
end
def header_tags
diff --git a/spec/workers/import/row_worker_spec.rb b/spec/workers/import/row_worker_spec.rb
index f173d497068..20de7831f84 100644
--- a/spec/workers/import/row_worker_spec.rb
+++ b/spec/workers/import/row_worker_spec.rb
@@ -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